CentOS7 安装Samba
1、安装Samba
yum install samba samba-client samba-common
2、备份Samba配置文件
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
3、新建conf文件
vi /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = centos security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /opt/ browsable =yes writable = yes guest ok = yes read only = no
4、启动服务
systemctl enable smb.service systemctl enable nmb.service systemctl restart smb.service systemctl restart nmb.service
5、关闭防火墙
systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动
6、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq! #保存退出 setenforce 0 #使配置立即生效
7、重启电脑
reboot