samba技术留档

发布时间:2020-07-25 08:18:47 作者:vekergu
来源:网络 阅读:806

[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



权限细化:

net use * /del


#security = share

client code page=936


display charset = UTF-8

unix charset = UTF-8

dos charset = UTF-8


passdb backend = tdbsam

security = user

encrypt passwords = yes

username map = /etc/samba/smbusers

smb passwd file = /etc/samba/smbpasswd



[ali_log]


#admin user = dev

path = /sc_log/ali_log

writeable = no

browseable = yes

guest ok = no

valid users = dev


[ali_code]


#admin user = dev


path = /sc_log/sc_code

writeable = no

browseable = yes

guest ok = no

valid users = dev


[ali_upload]

path = /upload/code


#admin users = test

valid users = test

writeable = yes

browseable = yes

guest ok = no


推荐阅读:
  1. samba
  2. mysql 去重留一

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

samba mb

上一篇:Linux安装Perl

下一篇:VBScript读取XML文件

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》