红联Linux门户
Linux帮助

增加samba用户提示Failed to add entry for user

发布时间:2015-10-25 10:36:24来源:linux网站作者:矢口

[root@ubuntu ~]# smbpasswd -a test
New SMB password:
Retype new SMB password:
Failed to add entry for user test.


解决办法:
这是因为没有加相应的系统账号,所以会提示Failed to add entry for user的错误,只需增加相应的系统账号test就可以了:
[root@ubuntu ~]# groupadd test -g 6000
[root@ubuntu ~]# useradd test -u 6000 -g 6000 -s /sbin/nologin -d /dev/null


这时就可以用smbpasswd -a test增加test这个samba账号了!为了增加系统的安全性,所以加的系统账号不要给shell它,也不给它指定目录,到时在/home目录给test账号建个文件夹,该文件夹只有test有读写权限即可!
如:
[root@ubuntu ~]# mkdir /home/test
[root@ubuntu ~]# chown -R test:test /home/test


若不想让另人访问,只让test用户可以访问,只需执行命令:
[root@ubuntu ~]# chmod u+rwx,g+rwx,o-rwx /home/test


这时可以用smbpasswd命令增加samba账号test了
[root@ubuntu ~]# smbpasswd -a test
New SMB password:
Retype new SMB password:
Added user test.


通过Samba从Windows向Linux系统传文件权限问题:http://www.linuxdiyf.com/linux/15130.html

Ubuntu15.04安装samba服务:http://www.linuxdiyf.com/linux/12925.html

fedora 22 samba使用:http://www.linuxdiyf.com/linux/14185.html

如何在Fedora或CentOS上使用Samba共享文件夹:http://www.linuxdiyf.com/linux/12396.html

Windows和RedHat Linux之间实现资源共享-Samba服务器:http://www.linuxdiyf.com/linux/10604.html