Centos7 配置 SAMBA
SAMBA: Linux下的一个服务,作用:在Linux服务器上设置一个共享目录,让Windows主机上可以访问(rw)这个目录
Centos7 配置 SAMBA步骤:
一、关闭selinux和firewall
关闭selinx:SELINUX=enforcing 改为 SELINUX=disabled
关闭firewall:systemctl stop firewalld
禁止防火墙开机启动:systemctl disable firewalld
二:配置SAMBA
进入/etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
map to guest = Bad User
guest ok = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[share]
comment = My Samba
path = /home/user/share
browseable = yes
writerable = yes
添加SAMBA用户
smbpasswd ‐a user 此时设置的密码是windows访问此目录时要输
入的密码。
启动Samba服务,输入命令 systemctl start smb
设置samba开机启动 systemctl enable smb.service
三、Windows下访问linux共享目录
可以看到此时的目录是linux下的目录
如果出现以下情况:
解决方案