下载
yum -y install samba samba-common samba-client
创建共享目录
mkdir -p /var/ftp/share
chmod 777 /var/ftp/share
配置文件
/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
[share]
path = /var/ftp/share
comment = samba
public = yes
writable = yes
browseable = yes
guest ok = yes
valid users = ftp
available = yes
创建登录用户
useradd -d /var/ftp/share/ -s /sbin/nologin ftp
passwd ftp
smbpasswd -a ftp
启动
systemctl start smb.service
网友评论