作者:!angel HdhCmsTesthackbase测试数据
工作原因偶配置sambs 服务器的时候比较多,所以写下来和大家共同探讨一下.本文是针对red hat linux 9 samba server的配置.希望能对像我一样的小菜有点帮助.本文没有什么技术含量.本人涉及linux的造诣不深,还请各位指教. samba server的配置文件在/etc/samba/下的smb.conf打开一个终端中输入: gedit /etc/samba/smb.conf 也可以用vi编辑.由于文件太长,我把个人认为没有用的东东删除了,主要是一些注释.下面偶解释一下主要字段的意思.由于我的这个文件配置过了,可能你的机器和我的不一样. ======================= Global Settings ===================================== [global] file://设 置samba服务整体环境 workgroup = hackase file://设 置工作组名 server string = angel server file://服 务器的名说明
; hosts allow = 192.168.1. 192.168.2. 127. file://限 制可访问此服务的IP范围,默认是全部 允许的,要是想设设置去掉前面的";" printcap name = /etc/printcap file://打 印机配置文件 load printers = yes file://是 否共享打印机
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups printing = cups file://打 印机的类型.标准打印机类型包括以上几种.
; guest account = pcguest file://pcguest 为用户名.可改去掉前边的";"让用户以 pcguest身份匿名登录,但保证/etc/passwd中有此人.
log file = /var/log/samba/%m.log file://为 登录服务器的用户建立不同的日志文件.
max log size = 0 file://日 志文件的大小,"0"代表无限制
file://以 下是smb.conf文件对服务器安全级别的设置 security = SHARE file://安 全性的级别共四种.share、user、server、domain
; password server = <NT-Server-Name> 密码验证服务器.
; password level = 8 file://密 码级别 ; username level = 8
encrypt passwords = yes file://用 户密码 加密 ,当然也可以不加密 smb passwd file = /etc/samba/smbpasswd file://将 密码服务器设置为samba server.需 要这个东东来指定验证文件.这个是文件 的路径,如果samba server是指定的win server这个不须要
; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt
unix password sync = Yes passwd program = /usr/bin/passwd %u passwd chat = *New*password* %n *Retype*new*password* %n *passwd:*all*authentication*tokens*updated*successfully*
pam password change = yes
; username map = /etc/samba/smbusers file://如 果每个 windows 用户在samba服务器中有帐户这 个可以不设 ; include = /etc/samba/smb.conf.%m
obey pam restrictions = yes
; interfaces = 192.168.12.2/24 192.168.13.2/24 如果多网段要在这里列出
; remote announce = 192.168.1.255 192.168.2.44
; local master = no
; os level = 33
; domain master = yes
; preferred master = yes
; domain logons = yes
; logon script = %m.bat
; logon script = %U.bat
; logon path = \%LProfiles\%U
; wins support = yes file://wins server支持
; wins server = w.x.y.z
; wins proxy = yes file://wins 代理设置
dns proxy = no file://dns 代理设置
; preserve case = no ; short preserve case = no
; default case = lower
; case sensitive = no
#============================ Share Definitions ============================== [homes] file://用 户访问自已目录的设置 comment = Home Directories file://说 明(以下同理) browseable = no//设定目录可不可以别人浏览 writeable = yes//用户写入自己的权限 valid users = %S create mode = 0664 directory mode = 0775
; [netlogon] file://此 段域用户登录目录设置 ; comment = Network Logon Service ; path = /usr/local/samba/lib/netlogon ; guest ok = yes ; writable = no ; share modes = no
;[Profiles] ; path = /usr/local/samba/profiles ; browseable = no ; guest ok = yes
[printers] file://打 印机设置 comment = All Printers path = /var/spool/samba browseable = no
printable = yes
;[tmp] file://用 户共享资源设置 ; comment = Temporary file space ; path = /tmp file://可 以自定义目录,去掉前边的";"就OK了 ; read only = no file://是 否只读或可写 ; public = yes
;[public] file://用 户共享资源设置 ; comment = Public Stuff ; path = /home/samba ; public = yes ; writable = yes ; printable = no ; write list = @staff
;[fredsprn] ; comment = Freds Printer ; valid users = fred ; path = /home/fred ; printer = freds_printer ; public = no ; writable = no ; printable = yes
;[fredsdir] ; comment
查看更多关于samba服务详解 - Windows操作系统 - 自学php的详细内容...