溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

samba技術(shù)留檔

發(fā)布時(shí)間:2020-07-25 08:18:47 來(lái)源:網(wǎng)絡(luò) 閱讀:799 作者:vekergu 欄目:開(kāi)發(fā)技術(shù)

[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


向AI問(wèn)一下細(xì)節(jié)
推薦閱讀:
  1. samba
  2. mysql 去重留一

免責(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)容。

AI