(转)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:

[quote]sudo apt-get install smbfs
[/quote]
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).

[quote]sudo mkdir /mount/my_share
[/quote]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.

[quote]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[/quote]


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.

[quote]sudo umount //192.168.1.102/share_name
[/quote]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:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值