CentOS Linux release 7.3.1611 (Core)
SELinux 已關閉
安裝 samba
#yum install samba
samba-4.4.4-12.el7_3.x86_64
複製備份設定檔
# cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
編輯設定檔
[global]
workgroup = OFFICE (改群組名稱)
加以下設定
netbios name = SCHOOL(伺服器名稱)
browseable = yes
加以下設定
netbios name = SCHOOL(伺服器名稱)
browseable = yes
unix charset = cp950 (中文BIG5)
dos charset = cp950 (中文BIG5)
unix extensions = no (關閉 unix extensions 允許 soft link)
unix extensions = no (關閉 unix extensions 允許 soft link)
[public]
comment = Public Stuff
path = /cnes
public = yes
writable = yes
printable = no
write list = +staff
wide links = yes (允許 soft link)
[student]
comment = Public student
path = /cnes/temp
browseable = No
force create mode = 0777
guest ok = Yes
read only = No
write list = @teacher @users
啟動 NMB、SMB
# systemctl start nmb
# systemctl start smb
設定 NMB、SMB 開機自動啟動
# systemctl enable nmb
# systemctl enable smb
開啟防火牆通道
# firewall-cmd --permanent --zone=public --add-service samba
其他:
開啟防火牆通道
# firewall-cmd --permanent --zone=public --add-service samba
其他:
- 以下視狀況調整
create mode = 664 (預設值)
directory mode = 775 (預設值) - 參數 encrypt passwords = no 似乎沒有作用
- 密碼無法和系統同步
- 先用 pdbedit 新增帳號
pdbedit -a USER
同時給一個預設密碼 - 再用 smbpasswd 個別找來修改密碼
smbpasswd USER - tdbsam 密碼資料庫在
/var/lib/samba/private/
沒有留言:
張貼留言