1. 查看linux中是否安装了samba。使用命令rpm -q samba
2. 在linux中下载安装samba。 使用命令 yum -y install samba(-y表示在安装过程中所有的提问都是yes)
3. 在/etc/samba下使用vim打开smb.conf。
添加需要添加的信息
具体添加方式链接:https://blog.csdn.net/weixin_40806910/article/details/81917077
4. 在本地添加用户,也可以使用默认用户
需要注意的是本地用户的密码和samba用户的密码是不一样的。需要添加samba用户的密码,才能进行访问。
5. 启用samba service samba start
6. 关闭iptables service iptables stop
如果iptables关闭不了的话可以使用
sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service
5. 在windows中添加映射。如果提示没有权限,则在linux中执行 setenforce 0