安装 samba rpm包
samba.x86_64 : Server and Client software to interoperate with Windows machines
查看selinux
getenforce
临时关闭selinux
setenforce 0
永久关闭selinux ,修改/etc/selinux/config配置文件中SELINUX 为 disable
SELINUX=disabled
关闭防火墙
systemctl stop firewalld.service
禁止防火墙开机自启动
systemctl disable firewalld.service
配置samba共享目录
[samba_share_for_windows]
comment = Network Logon Service
path = /home/samba_share
writable = yes
browseable = yes
guest ok = yes
smbpasswd 来添加Samba用户,并设置密码。原理是通过读取/etc/passwd文件中存在的用户名
[root@localhost samba_share]# smbpasswd -a root
New SMB password:
Retype new SMB password:
[root@localhost samba_share]#
增加samba账户对共享目录的而访问权限
[root@localhost samba_share]# chown root:root /home/samba_share
重启samba服务即可
systemctl restart smb