且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ubuntu普通用户使用samba实现文件共享的设置

更新时间:2022-01-05 23:01:50

问题:
普通用户创建共享,会提示错误: 
'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares.
Error Permission denied You do not have permission to create a usershare.
Ask your administrator to grant you permissions to create a share.

解决方法:
以下内容是从从http://zhidao.baidu.com/question/189257268.html文章中的思路实现的。

[1]安装samba
sudo apt-get install samba smbfs
[2]设置samba密码
sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a yourname #yourname 表示你的用户名
然后按照提示设置密码

普通用户登陆后,此时创建共享,会提示错误: 
'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares.
Error Permission denied You do not have permission to create a usershare.
Ask your administrator to grant you permissions to create a share.
只需要将该用户加入sambashare用户组
[3]sudo adduser yourname sambashare
[4]logout后重新登陆你就可以设置共享文件夹了。
不过此时你还不能应用你的共享,你需要先设置你的samba密码。
[5]sudo smbpasswd –a yourname
然后按照提示设置你的samba密码。





本文转自博客园zhyiwww 的博客,原文链接:http://www.blogjava.net/zhyiwww/,如需转载请自行联系原博主。