在 system1 上配置SMB服務 ,要求:
1、您的 SMB 服務器必須是 STAFF 工作組的一個成員
2、共享 /common 目錄,共享名必須為 common
3、只有 group8.example.com 域內的客戶端可以訪問common共享
4、common 必須是可以瀏覽的
5、用戶 andy 必須能夠讀取共享中的內容,如果需要的話,驗證密碼是redhat
答:
一、再system1上執行
1、安裝軟包並去報服務開機啟動
yum install samba samba-client -y
systemctl enable smb.service nmb.service
2、設定防火牆
firewall-cmd --permanent --add-service=samba
firewall-cmd --reload
3、編輯配置文件
vim /etc/samba/smb.conf
# 修改為STAFF [global] .... workgroup=STAFF .... # 底部新增common [common] path=/common hosts allow=172.24.8. browseable=yes
4、創建目錄並設定 selinux 上下文
# 創建共享目錄 mkdir /common # 添加SELINUX semanage fcontext -a -t "samba_share_t" '/common(/.*)?' # 執行SELINUX restorecon -Rv /common/
5、創建 andy 系統用戶、創建 samba 用戶
useradd andy
密碼:redhat
smbpasswd -a andy
New SMB password: redhat
Retype new SMB password: redhat
Added user andy.
6、啟動服務
systemctl restart smb nmb
更多詳情:https://www.cnblogs.com/xiangsikai/p/9158745.html