`
gyht0808
  • 浏览: 111931 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

(转)Mounting Windows SMB File Shares Using Cifs

阅读更多
Firs, we need to install cifs, which comes right alongside smbfs. If you have smbfs, then you have cifs. If you don't, open up a terminal and get it:

引用
sudo apt-get install smbfs

Next, all mounted drives need to mount to some folder on your local drive. I prefer to mount mine in the /media folder, which makes sense, as your cdrom is mounted there along with other drives, including things like external and thumb drives. Type the following, replacing my_share with whatever folder name you want your share to be (this doesn't matter at all, it can be called anything and go anywhere).

引用
sudo mkdir /mount/my_share
Now, while we're going to perform some permanent mounts later (so that the disk mounts after a restart), let's start with a manual mount.

引用
sudo mount -t cifs //192.168.1.102/share_name /media/my_share -o username=theuser,password=thepass,iocharset=utf8,file_mode=0777,dir_mode=0777



We now have proof of concept, but we want the drive to mount automatically on restart. First, let's unmount the drive so that we can test our remounting of it later. The following should do it.

引用
sudo umount //192.168.1.102/share_name
The share should've disappeared from your desktop. Important, we will use the /etc/fstab file to mount the share by inserting a similar command as above into that file. This file can be read by anyone on your computer, which would mean that anyone could read the username and password you specify for you mount. If you don't care (come on guys, care a little), then simply do the following:
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics