from:
http://www.centoscn.com/CentosServer/ftp/2015/0929/6248.html
http://www.centoscn.com/CentosServer/ftp/2015/0131/4606.html
配置文件1:
# 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
[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
;writable = 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 = root
create mask = 0664
directory mask = 0775
[share]
comment = my share directory
path = /home/pzb/workSpace
public = yes
writable = yes
read only = no
browseable = yes
valid users = pzb
配置文件2:
# 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 = WORKGROUP
server string = Samba Server Version %v
# logs split per machine
# max 50KB per log file, then rotate
security = user
passdb backend = tdbsam
# the login script name depends on the machine name
# the login script name depends on the unix user used
# disables profiles support by specifing an empty path
load printers = yes
cups options = raw
#obtain list of printers automatically on SystemV
[project]
commnet = Public Share with movie files
path = /root/TeamTalk-master
# valid user = abc,@root
# write list = hanlg,root
public = yes
read only = no
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /root/TeamTalk-master
public = yes
writable = yes
browseable = yes
printable = no
guest ok = yes
[share]
comment = my share directory
path = /root/TeamTalk-master
public = yes
writable = yes
read only = no
browseable = yes
valid users = root
配置文件1 或 配置文件2
任选一个
再
smbpasswd -a root,输入密码
保证服务启动,防火墙关闭,关闭SELinux(参考),修改共享目录的属性,chown root.root /root/TeamTalk-master一定不能少
WINDOWS下: “"映射网络驱动器"”配置链接共享目录
samba服务
systemctl restart smb
systemctl status smb
启动Samba服务,设置开机启动
[root@base samba]# systemctl start smb
[root@base samba]# systemctl enable smb