虚拟机安装samba的几个注意的地方
步骤参考
https://www.cnblogs.com/mylinux/p/5202792.html
1)
smb.conf
workgroup一定要和外面windows机子计算机属性里的工作组一致
2)
smbpasswd -a ...
这个密码可以和linux相同用户的登录密码不一样
3)
记得关闭防火墙和SELinux,否则连不上。
关闭防火墙
步骤原文中有关闭iptables,但centos7中已经改成firewalld。
使用命令:systemctl stop firewalld.service
关闭运行的防火墙
输入命令:systemctl disable firewalld.service,禁止防火墙服务器
关闭SELinux
# getenforce 命令可以查看SElinux的状态 ,# setenforce 0可以暂时关闭SElinux,在/etc/selinux/config中把SELINUX= enforcing更改为SELINUX=disable可以永久关闭SELinux
4)
smb.conf配置实例
如果不配置这个www的话,机子就连接不上, 不理解为什么
[www]
path = /var/www
public = yes
writable = yes
centos9中要添加:
display charset = UTF-8
否则会卡爆
这个加了和不加似乎没区别:
unix charset = UTF-8
last)
这样安装实际上是不安全的,不过虚拟机也无所谓了,如果在生产上具体安全的方法看smb.conf.example。

浙公网安备 33010602011771号