1、apt install samba -y
2、打开配置文件
vim /etc/samba/smb.conf
添加共享文件路径及其权限
[share]
path = /home/share
available = yes
browseable = yes
public = yes
writable = yes
valid users = samba
(连接显示拒绝访问,可以删掉这行)
3、创建samba用户
useradd samba(用户)
sudo smbpasswd -a samba
4、重启
sudo /etc/init.d/samba restart
5、windows关联Centos的共享目录
\\172.17.0.241\share