當安全等級為user時,這時我們在本機建立的使用者必須加入到SMB伺服器中,命令為 smbpasswd -a 使用者 添加LINUX使用者到SMB伺服器中,smbpasswd 使用者名稱 修改SMB伺服器中使用者的口令
#======================= Global Settings ===================================== 全域參數配置,設定的是針對所有的資源
[global]
# workgroup = NT-Domain-Name or Workgroup-Name ---------------------------- 工作群組的名稱(可以不填,預設就這樣)
workgroup = soft
# server string is the equivalent of the NT Description field
server string = Samba Server --------------------------------------------- 對SMB伺服器的簡要說明
hosts allow = 192.168.1. 192.168.2. 127. -------------------------------- 設定可訪問SMB伺服器的主機(可為IP,主機名稱,網域名稱)
# Security mode. Most people will want user level security. See
# security_level.txt for details. ------------------------------ 指定SMB伺服器的使用的安全等級。 security = share 指的是當客戶機連入SMB伺服器時,不需要帳號密碼就可以訪問資源。
security = user 指的是當客戶煉乳SMB伺服器時,必須輸入使用者名稱和密碼才能訪問
security = user
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
#============================ Share Definitions ==============================共用資源參數配置
[homes] -----------------------使用者以帳號和密碼訪問,是否允許進入自己的宿主資料夾
comment = Home Directories (預設就這樣,可以不要修改)
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
[printers] ----------------------------印表機配置
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
[pp] --------------------以下是我所共用的檔案夾
comment = this is our soft! 共用說明
path = /www/pp 共用資料夾的路徑
write list = smb 允許寫入許可權的使用者列表,smb使用者允許寫入
read list = 唯讀許可權的使用者列表
public = yes 是否允許發布