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下的目录

如果出现以下情况:

解决方案

本文详细介绍了如何在CentOS7上配置Samba服务,包括关闭selinux和firewall,编辑smb.conf配置文件,创建Samba用户,启动和设置Samba服务开机启动。通过这些步骤,可以使得Windows系统能够访问Linux的共享目录。
4098

被折叠的 条评论
为什么被折叠?



