借助了webmin工具
#======================= Global Settings =====================================
[global]
log file = /var/log/samba/%m.log
load printers = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
null passwords = yes
encrypt passwords = yes
dns proxy = no
cups options = raw
netbios name = centos
netbios aliases = centos
server string = Samba Server
workgroup = 41-313
os level = 20
printcap name = /etc/printcap
security = share
max log size = 50
[public]
comment = public ' s share
writeable = yes
path = /home/goon/public
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; read only = yes
; write list = @staff
# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
; comment = Fred's Printer
; valid users = fred
; path = /homes/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes
# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no
# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %u option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/pc/%m
; public = no
; writable = yes
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
[winD]
comment = winD ' s share
guest only = yes
public = yes
path = /mnt/winD
[winE]
comment = winE ' s share
guest only = yes
public = yes
path = /mnt/winE
[smbshare]
comment = smbshare ' s share and r/w
writeable = yes
guest only = yes
public = yes
path = /mnt/smbshare
#这个就可以,可读写删,但是windwos上传文件属于nobody/nobody,至于public不可以,可能是由于他属于goon用户吧
#要使可读可写可删,必须要从两方面来综合,文件夹本身的权限和smb赋予的权限,去最严格的
#若是user模式,在windwos访问linux samba服务器,即点击centos会要求输入用户名/密码;若shared模式就不用
#winD winE 是任何用户可读 guest only = yes
#public如下时
#[public]
# comment = public ' s share
# writeable = yes
# path = /home/goon/public
#windows下点击public,需要用户名/密码,可以访问,能够上传中文文件,且显示客/服都显示正常;
#webmin下看到是-所有已知用户可读可写
#public如下时
#[public]
# comment = public ' s share
# writeable = yes
# public = yes
# path = /home/goon/public
#windows下点击public,弹出无法访问网络的对话框;webmin下看到是-都可以读/写
#public如下时
#[public]
# comment = public ' s share
# writeable = yes
# guest only = yes
# public = yes
# path = /home/goon/public
#windows下点击public,弹出无法访问网络的对话框;webmin下看到是-都可以读/写,,结果和上面的一样、
#linux服务器端没法访问window客户端的共享文档,点击时,弹出没有权限对话框,而检查windows的共享是开放给everyone
#
#samba配置失败主要在于对文件夹的权限没搞对。
#