1、yum安装smb服务
yum install samba
2、创建共享文件夹pub
cd /usr
mkdir pub
3、设置pub文件夹权限
chmod 055 pub
4、创建配置文件
cd /etc/samba
vi smb.conf
smb.conf配置,
文件夹为test映射到/usr/pub,文件不可写只可读。
配置访问者是所有用户,不需要账号密码。
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = indishell-lab
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no
bind interfaces only = yes
[test]
path = /usr/pub
writable = no
guest ok = yes
guest only = yes
read only = yes
directory mode = 0555
5、重启smb服务
systemctl restart smb.service
6、关闭防火墙
systemctl stop firewalld.service
7、访问成功