Samba文件系统安装与配置
系统版本:Centos 7.9
安装samba服务
yum install -y samba
关闭防火墙
systemctl status firewalld
systemctl disable firewalld
systemctl stop firewalld
关闭selinux
vim /etc/selinux/config
将SELINUX
值修改为disabled
添加用户并配置smb访问密码
useradd public
smbpasswd -a public
修改smb.conf配置文件
vim /etc/samba/smb.conf
修改配置文件为以下内容
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
client code page = 939 //支持简体中文共享
[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
[公司共享]
comment = 公司共享
path = /data/samba/public // samba文件物理地址
write list = public // 设置可写入的用户
valid users = public // 设置有效用户
create mask = 0777 // 设置用户创建的文件权限
directory mask = 0777 // 设置用户创建的文件夹权限
重启smb服务
systemctl restart smb
systemctl enable smbd # 设置开机自启