在CentOS
中安装samba
安装
代码语言:shell复制dnf install samba samba-common samba-client
# 或
yum install samba samba-common samba-client
配置
代码语言:shell复制$ sudo vim /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[web]
path = /www
browseable=yes
writable=yes
添加用户和密码
注意这里的smbuser
是系统中存在的用户,或新建
$ sudo smbpasswd -a smbuser
防火墙
在防火墙上允许samba服务(或直接关闭)
代码语言:shell复制$ sudo firewall-cmd --add-service=samba --zone=public --permanent
$ sudo firewall-cmd --reload
启动并启用Samba和nmb服务
代码语言:shell复制$ sudo systemctl start smb
$ sudo systemctl enable smb
$ sudo systemctl status smb
$ sudo systemctl start nmb
$ sudo systemctl enable nmb
$ sudo systemctl status nmb
Mac端访问
"前往->连接服务器“配置
代码语言:txt复制smb://192.168.7.2