iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 25
0

用YUM安裝Samba

yum install samba samba-client samba-common -y

Samba的設定檔/etc/samba/smb.conf,加入以下內容:

[global]
workgroup = MYGROUP
server string = Samba Server %v
netbios name = centos_7
security = user
map to guest = bad user
dns proxy = no
 
[Secure]
path = /home/share_dir
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes

儲存檔案後啟動Samba,及設定開機自動啟動:

mkdir -p / samba / anonymous 
systemctl enable smb 
systemctl enable nmb 
systemctl restart smb 
systemctl restart nmb

設定Samba對外開放與權限:

firewall -perd-service = samba 
firewall-cmd -reload 
mkdir / home / share_dir 
chown -R smb_user:smbgrp / home / share_dir 
chmod -R 0770 / home / share_dir 
chcon -t samba_share_t / home / share_dir

建立Samba帳密

useradd smb_user 
groupadd smbgrp 
usermod -a -G smbgrp smb_user 
smbpasswd -a smb_user

上一篇
Linux從零開始(24/30):服務檢視
下一篇
Linux從零開始(26/30): 例行性工作排程crontab
系列文
Linux從零開始30

尚未有邦友留言

立即登入留言