samba是一个实现smb协议的开源软件,为局域网内的不同计算机之间提供文件和打印机共享服务。

1.安装
yum groupinstall “file-server” -y

2.配置
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
mkdir /share
chmod -R 755 /share
firewall-cmd —permanent —zone=public —add-service=samba
firewall-cmd —reload
vim /etc/samba/smb.conf
[share]
path = /share
read only = no
guest ok = yes
browsable = yes
writable = yes
create mask = 0755
directory mask = 0755

3.创建samba用户
smbpasswd -a user1
vim /etc/samba/smb.conf
valid users = user1

4.启动
systemctl start smb
systemctl start nmb

5.测试
smb://192.168.1.20