access windows share with smbclient and mount with cifs

3 篇文章 0 订阅

suppose my windows server is YJ104. and hthe work group is "WORKGROUP", and I have created a user name called "bq". 

you'd first share a folder and enables permission for YJ104\bq;, 

to visit hte files from smbclient, you can do is like this:

smbclient //YJ104/share -Ubq -WWORKGROU

and you can ls on files ..

when this is ready, you can mount the files, here is what  you do:

bq@ubuntu:~$ sudo mount -t cifs -o username=bq,workgroup=workgroup,password=password,uid=bq,gid=sudo,file_mode=0640,dir_mode=0750 //YJ104/share /mnt/share


you may need to first make dir /mnt/share

mkdir -p /mnt/share

you can check on the gid, uid of user bq by :

id boqwang


P.S, you may want to add the following line to the /etc/hosts file, so it knows the YJ104

bq@ubuntu:~$ cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	ubuntu
192.168.61.1	YJ104



You may refer to this pages for details on how to troubleshooting 

  Permission denied after successfully mounting a directory with smbfs : http://www.jroller.com/agileanswers/entry/permission_denied_after_successfully_mounting


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值