1.安装smaba服务: yum install samba samba-client samba-common
2.修改 /etc/smaba/smb.conf 文件
[global]
security = user
netbios name = centos
server string = Samba Server
map to guest = bad user
[shareroot]
path = /root/share
writable = yes
browsable = yes
read only = no
testparm -v 用来检查配置文件是否正确
3. 添加smaba用户
smbpasswd -a root
输2遍密码
4.启动smb,并设置为开机启动
systemctl restart smb.service
systemctl enable smb.service
5.防火墙允许smb服务
firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
6.windows右键我的电脑点击映射网络驱动器
\\server\shareroot (一定要注意server后面是配置文件里面的[shareroot] 不是下面的配置路径,
比如:\\192.168.0.193\shareroot. 这个坑弄了快2个小时,擦。。)