samba centos安装
- 安装samba
yum install -y samba
- 新建用户
useradd baozi
mbpasswd -a baozi
usermod -a -G root baozi
# 记录
id baozi #查看用户属性
gpasswd -d baozi root #用户移除组
- 修改配置文件
vim /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
[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
[root]
comment = samba share
path = /
browseable = yes
writeable = yes
guest ok = no
read only = no
valid user = root
- 启动服务
systemctl start smb.service