access windows share with smbclient and mount with cifs

来源:互联网 发布:网络教育公共课考试 编辑:程序博客网 时间:2024/05/23 18:45

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/hosts127.0.0.1localhost127.0.1.1ubuntu192.168.61.1YJ104



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


原创粉丝点击