通过 SMB 共享目录

在 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、创建 samba 用户

smbpasswd -a andy
New SMB password: redhat
Retype new SMB password: redhat
Added user andy.

6、启动服务

systemctl restart smb nmb

 

猜你喜欢

转载自www.cnblogs.com/xiangsikai/p/10882604.html
SMB
今日推荐