先运行下面命令查看smb服务是否启动
systemctl status smb.service
如果是运行状态可以用testparm查看配置状态
➜ ~ testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[mysmb]"
Loaded services file OK.
Server role: ROLE_STANDALONE
如果没有问题下一步可以用smbclient测试本地连接,没有密码直接回车
➜ ~ smbclient //127.0.0.1/mysmb
Enter SAMBA\root's password:
Anonymous login successful
Try "help" to get a list of possible commands.
smb: \>
如果能正常访问那应该就是防火墙的问题了,直接使用firwall-cmd将端口139和445允许通过,然后重启防火墙服务
➜ ~ firewall-cmd --zone=public --add-port=139/tcp --permanent
success
➜ ~ firewall-cmd --zone=public --add-port=445/tcp --permanent
success
➜ ~ systemctl restart firewalld
我要评论