增加samba用户提示Failed to add entry for user
2016-03-26 18:19
405 查看
转自增加samba用户提示Failed to add entry for user
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.
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.
相关文章推荐
- Educational Codeforces Round 5 E. Sum of Remainders
- AIDL调用指南
- 加入百度地图遇到 framework not found BaiduMapAPI***
- 在main方法中调用service
- HDU1021-Fibonacci Again,,找规律就好了~~~
- golang sync WaitGroup
- Hive连接Mysql---FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
- Eval()和DataBinder Eval(Container DataItem,)的区别及用法
- Airplane mode的三种切换方式
- PAT (Advanced Level) Practise 1106 Lowest Price in Supply Chain (25)
- 你应该知道的最好Webmail邮件客户端,
- 8款世界级Webmail工具推荐
- jps 报process information unavailable解决办法
- coderforce Educational Codeforces Round 10 C. Foe Pairs(贪心)
- FATAL: Peer authentication failed for user "geo_rails_test_creator"
- Codeforences Educational Round10 C. Foe Pairs
- [LeetCode] Paint House II 粉刷房子之二
- 职责链模式
- 2440test 裸机測试 调试不进main 设置改动方法
- WHY IE AGAIN? - string.charAt(x) or string[x]?