码迷,mamicode.com
首页 > 其他好文 > 详细

samba技术留档

时间:2015-10-10 10:42:32      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:samba

[root@qhfax code]# smbpasswd -a nginx

New SMB password:

Retype new SMB password:

Added user nginx.



smbpasswd 属于samba套件,能够实现添加或删除samba用户和为用户修改密码


参数:

 -a:向smbpasswd文件中添加用户;

 -c:指定samba的配置文件;

 -x:从smbpasswd文件中删除用户;

 -d:在smbpasswd文件中禁用指定的用户;

 -e:在smbpasswd文件中激活指定的用户;

 -n:将指定的用户的密码置空。



问题:

smbpasswd samba

New SMB password:

Retype new SMB password:

Failed to find entry for user samba.


解决方法,加参数‘-a‘:


# smbpasswd  -a samba

New SMB password:

Retype new SMB password:

Failed to add entry for samba


解决方法:

vi /etc/samba/smb.conf 编辑smb.conf 文件


将;security = share修改为 security user

这是因为没有加相应的系统账号,所以会提示Failed to add entry for user的错误,只需增加相应的系统账号test就可以了


useradd  nginx

[root@qhfax samba]# smbpasswd -a nginx

New SMB password:

Retype new SMB password:




workgroup = LinuxSir

netbios name = LinuxSir05

server string = Linux Samba Server TestServer

security = share

client code page=936


display charset = UTF-8

unix charset = UTF-8

dos charset = UTF-8


security = user 

encrypt passwords = yes

smb passwd file = /etc/samba/smbpasswd



[log]

path = /log/abc

writeable = no

browseable = yes

guest ok = yes


补充:

以上设置中,smb passwd file = /etc/samba/smbpasswd文件没有生效,smbpasswd命令成功后,测试也是成功的,但是没有写入这个密码文件,最后通过查找,原来密码是存储在这里:

[root@qhfax samba]# ll /var/lib/samba/private

总用量 832

-rw------- 1 root root 421888 10月 10 10:07 passdb.tdb

-rw------- 1 root root 430080 4月   1 2015 secrets.tdb


本文出自 “运维路上” 博客,请务必保留此出处http://vekergu.blog.51cto.com/9966832/1701431

samba技术留档

标签:samba

原文地址:http://vekergu.blog.51cto.com/9966832/1701431

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!