# smb设置参考手册 #
# #
#----------------------------------------------------------------------------------#
[global]
#----------------------------------------------------------------------------------#
# workgroup = NT-Domain-Name or Workgroup-Name
#工作组设置本地网络使用工作组名字(或者是域)否则,Windows客户就不能从其网络邻居中发现这个Samba服务器。当然,你要是设置成域时,要把 security = domain设置成这样
workgroup = Sa119
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# server string is the equivalent of the NT Description field
#server string是对于本地服务器的简单描述,这些信息将作为这台服务器的属性,返回给#Browser,显示在Windows客户中作为对这个服务器的描述。
server string = Linux Smb
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
#用于限制可以访问这台samba服务器的客户机的IP地址范围,以提供安全限制。缺省情#况下,这行配置被注释了, 即所有的客户都可以访问这台计算机,这样就存在一定的安全问题。
#通常可以这样hosts allow = 192.168.0. 。整个网络号为192.168.0的机器都可以访问,其它的都将拒绝连接(注意最后的那个".")
hosts allow = 192.168.0.
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# if you want to automatically load your printer list rather
# than setting them up individually then youll need this
#这些设置是用于设置samba服务器的打印机资源,load printer=yes就允许samba服务器对外共享服务器的打印机。
#打印机?...........我没.............
printcap name = /etc/printcap
load printers = yes
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
#定义打印系统的类型
printing = lprng
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
#由于Mircrosoft客户没有用户的概念,因此有时会用没有用户和口令的请求访问服务器,就需要将这个没有用户的请求映射为系统中的某个用户,Samba服务器才能安全的访问系统。guest account 就定义这样的请求在Unix下对应的用户权限。为了安全的原因,不能让这个帐户在系统中有可写的权限,通常可以增加一个专用帐户,如pcguest。如果这个设置被注释的情况下,系统缺省使用nobody执行 Windows客户的请求。建议不要使用nobody用户,因为系统中的很多程序缺省都使用它,因此就会有安全问题。
#通常可以这样做先在下面的开关设置security = share ,使smb服务工作于共享级别,删除系统中的nobody帐号,打开 guest account = pcguest (既去掉 ";")
#在系统里添加一个smb组 groupadd -g 300 smb
#添加smb游客帐号 useradd -u 300 -g 300 -d /dev/null -s /dev/null smbguest 这样都将用smbguest这个帐号来影射访问请求
#注意一点的是,当你把security = user设置成这样(smb服务工作于用户级别)一但验证失败,将退回到share级别
guest account = smbguest
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# this tells Samba to use a separate log file for each machine
# that connects
#这里定义samba的日志文件路径,%m用于代表从访问的NetBIOS 计算机名,如果使用的用户级认证,还可以使用%U表示不同的登录用户。例如从一名字为cainiao的计算机访问samba服务器的日志,将记录在 /var/log/samba/cainiao.log文件中。
# 一些变量说明:
#%S = 当前服务名
#%P = 当前服务的根目录
#%u = 当前服务的用户名
#%g = 当前用户说在的主工作组
#%U = 当前对话的用户名
#%G = 当前对话的用户的主工作组
#%H = 当前服务的用户的Home目录
#%v = Samba服务的版本号。
#%h = 运行Samba服务机器的主机名
#%m = 客户机的NETBIOS名称
#%L = 服务器的NETBIOS名称
#%M = 客户机的主机名
#%N = NIS服务器名
#%p = NIS服务的Home目录
#%R = 说采用的协议等级(值可以是CORE, COREPLUS, LANMAN1, LANMAN2,NT1)
#%d = 当前服务进程的ID
#%a = 客户机的系统
#%I = 客户机的IP
#%T = 当前日期和时间
log file = /var/log/samba/%I.log
#----------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------#
# Put a capping on the size of the log files (in Kb).
#max log size定义每个日志文件的存储限制。默认是0,(无限制)
#一定要定义好,防止硬盘被爆掉 ^_^
max log size = 20
#----------------------------------------------