1、安装
[root@localhost ]# yum install samba samba-client samba-common
2、配置服务
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
[samba]
path = /opt
browsable =yes
writable = yes
guest ok = yes
read only = no
3、启动smb服务
[root@localhost samba]# systemctl start smb
[root@localhost samba]# systemctl status smb
4、关闭防火墙
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=samba
[root@localhost ~]# firewall-cmd --reload
5、我们下面给匿名用户一个权限:
chmod -R 0777 /opt
chown -R nobody:nobody /opt
进一步我们需要配置Selinux
chcon -t samba_share_t /opt
6、现在你可以在Windows中访问CentOS7的共享文件了,在命令提示行中输入:
\\centos