centos7 samba 共享使用

samba安装:
yum install -y samba
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vim /etc/samba/smb.conf
添加如下内容:
[docker]
comment = docker
path =/home/samba
writable = yes
create mask = 1777
directory mask = 1777
useradd -d /home/samba samba #添加samba用户并指定home目录
smbpasswd -a samba #设置samba用户密码
systemctl disable firewalld #关闭防火墙
vim /etc/selinux/config
将SELINUX=enforcing 修改为 SELINUX=disabled
systemctl restart smb #重启
systemctl enable smb #修改为开机启动
然后在windows 我的电脑窗口上边地址 栏 输入\\192.168.3.55 samba主机ip,输入用户和密码即可访问
2. 关闭开机启动:sudo systemctl disable firewalld.service