您好,登錄后才能下訂單哦!
[root@qhfax code]# smbpasswd -a nginx
New SMB password:
Retype new SMB password:
Added user nginx.
smbpasswd 屬于samba套件,能夠?qū)崿F(xiàn)添加或刪除samba用戶和為用戶修改密碼
參數(shù):
-a:向smbpasswd文件中添加用戶;
-c:指定samba的配置文件;
-x:從smbpasswd文件中刪除用戶;
-d:在smbpasswd文件中禁用指定的用戶;
-e:在smbpasswd文件中激活指定的用戶;
-n:將指定的用戶的密碼置空。
問(wèn)題:
smbpasswd samba
New SMB password:
Retype new SMB password:
Failed to find entry for user samba.
解決方法,加參數(shù)'-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
這是因?yàn)闆](méi)有加相應(yīng)的系統(tǒng)賬號(hào),所以會(huì)提示Failed to add entry for user的錯(cuò)誤,只需增加相應(yīng)的系統(tǒng)賬號(hào)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
補(bǔ)充:
以上設(shè)置中,smb passwd file = /etc/samba/smbpasswd文件沒(méi)有生效,smbpasswd命令成功后,測(cè)試也是成功的,但是沒(méi)有寫入這個(gè)密碼文件,最后通過(guò)查找,原來(lái)密碼是存儲(chǔ)在這里:
[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
權(quán)限細(xì)化:
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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。