Linux 版 (精华区)
发信人: tcpip (偶的昵称改了), 信区: Linux
标 题: smb.conf(5)--from linux forum--2
发信站: 紫 丁 香 (Mon Jan 3 12:47:28 2000) WWW-POST
The [printers] section (打印机共享设置段)
This section works like [homes], but for printers.
这一段很象[homes]段,不过是用于设置共享打印机的.
If a [printers] section occurs in the configuration
file, users are able to connect to any printer
specified in the local host's printcap file.
如果在本配置文件中存在[printers]段,用户就可以连接到
在主机上的printcap文件中指定的任一打印机.
When a connection request is made, the existing
sections are scanned. If a match is found, it is
used. If no match is found, but a [homes] section
exists, it is used as described above. Otherwise,
the requested section name is treated as a printer
name and the appropriate printcap file is scanned
to see if the requested section name is a valid
printer share name. If a match is found, a new
printer share is created by cloning the [printers]
section.
当服务器收到连接请求时,首先在已定义的段中搜索,如果段
名与被请求的共享资源名一致,则该段的内容就被采用.如果
没有找到匹配的段,且在配置文件中存在[homes]段,则按照
前面所说的方式处理.否则,被请求的资源就被当作是一个打
印机名,服务器在适当的printcap文件中查找,检验被请求的
共享资源名是否是有效的打印机共享名.如果共享名匹配,服
务器就会复制[printers]段的内容来生成一个共享打印服务
(供用户使用).
A few modifications are then made to the newly cre-
ated share:
这个新生成的共享打印服务要做少量如下改动:
(和[printers]段相比)
o The share name is set to the located printer name
共享名被设置为查找到的打印机名
o If no printer name was given, the printer name is
set to the located printer name
如果未设置打印机名,则前面查找到的打印机名就作为该打印
机名.
o If the share does not permit guest access and no
username was given, the username is set to the
located printer name.
如果该共享资源不允许以来访者身份进行操作,且用户名没有
给出,那么用户名就被设为前面查找到的打印机名.
Note that the [printers] service MUST be printable
- if you specify otherwise, the server will refuse
to load the configuration file.
注意,[printers]段必须设置为可打印的(printable),如果你
做了相反的设置,服务器会拒绝装载该配置文件.
Typically the path specified would be that of a
world-writeable spool directory with the sticky bit
set on it. A typical [printers] entry would look
like this:
典型的path(路径)用粘贴位设成一个公用的可写缓冲区。
一个典型的[printers]段一般就象下面示范的那样:
[printers]
path = /usr/spool/public
writeable = no
guest ok = yes
printable = yes
All aliases given for a printer in the printcap
file are legitimate printer names as far as the
server is concerned. If your printing subsystem
doesn't work like that, you will have to set up a
pseudo-printcap. This is a file consisting of one
or more lines like this:
每个打印机在printcap文件中列出的所有别名是与服务器相关
的所有有效的打印机名.如果你的系统的打印子系统的工作方式
不是这样,你就必须设置一个假的printcap文件,其中的包含一
行或多行下面格式的设置:
alias|alias|alias|alias...
别名1|别名2|别名3|别名4...
Each alias should be an acceptable printer name for
your printing subsystem. In the [global] section,
specify the new file as your printcap. The server
will then only recognize names found in your
pseudo-printcap, which of course can contain what-
ever aliases you like. The same technique could be
used simply to limit access to a subset of your
local printers.
每个别名必须是你的打印子系统可以接受的打印机名.在[glo-
bal]段中指定这个新文件作为你的printcap文件.这个假prin-
tcap文件可以包含任何你所喜欢的别名,而服务器将只识别在此
文件中列出的名字.这个技术可以很方便的用于限制对你的本地
打印机的子集的访问.
An alias, by the way, is defined as any component
of the first entry of a printcap record. Records
are separated by newlines, components (if there are
more than one) are separated by vertical bar sym-
bols ("|").
顺便提一下,别名在printcap文件中被定义为每个记录的第一个
条目的成分.记录由换行分隔.如果一条记录中有多个成分,成分
之间由"|"符号分隔.
NOTE: On SYSV systems which use lpstat to determine
what printers are defined on the system you may be
able to use "printcap name = lpstat" to automati-
cally obtain a list of printers. See the "printcap
name" option for more details.
注意,在SYSV系统中,使用lpstat来确定系统中安装了什么样
的打印机.你可以设置"printcap name = lpstat"来自动获
得打印机列表.详情参见"printcap name"选项.
PARAMETERS(参数)
Parameters define the specific attributes of sections.
参数定义了每个段的细节特征.
Some parameters are specific to the [global] section
(e.g., security). Some parameters are usable in all sec-
tions (e.g., create mode). All others are permissible only
in normal sections. For the purposes of the following
descriptions the [homes] and [printers] sections will be
considered normal. The letter 'G' in parentheses indi-
cates that a parameter is specific to the [global] sec-
tion. The letter 'S' indicates that a parameter can be
specified in a service specific section. Note that all 'S'
parameters can also be specified in the [global] section -
in which case they will define the default behavior for
all services.
有些参数是在[global]段中设定的(比如有关安全特性的设置),有些参
数是可以出现在任何段落中的(比如生成方式),剩下的那些参数就只能
出现在普通的段落中了.在以后的描述中,[homes]和[printers]段被看
作是普通的段落.标记(G)表示此参数只能在[global]段中设置,标记(S)
表示此参数可以在服务定义段落中设置.注意,有(S)标记的参数也可以
出现在[global]段中,在这种情况下,这个参数设置被当作所有其他段落
的缺省设置.
Parameters are arranged here in alphabetical order - this
may not create best bedfellows, but at least you can find
them! Where there are synonyms, the preferred synonym is
described, others refer to the preferred synonym.
参数的详细说明是按照字母顺序排列的,这样也许不是最好的分类方式,
但至少保证你可以找得到他们.如果有多个同义词,那么我们只对首选的
那个参数名作详细说明,其他的同义词都只指明参阅那个首选的参数名.
VARIABLE SUBSTITUTIONS(变量置换)
Many of the strings that are settable in the config file
can take substitutions. For example the option "path =
/tmp/%u" would be interpreted as "path = /tmp/john" if the
user connected with the username john.
许多在配置文件中可设置的字符串都可以进行替换.例如,当用户以john
的用户名建立连接后,选项"path = /tmp/%u"就被解释成"path = /tmp-
/john".
These substitutions are mostly noted in the descriptions
below, but there are some general substitutions which
apply whenever they might be relevant. These are:
大部分置换在后面的描述中说明,这里说明一些可以在任何地方被引
用的全局置换.它们是:
o %S = the name of the current service, if any.
%S = 当前服务名
o %P = the root directory of the current service, if
any.
%P = 当前服务的根目录
o %u = user name of the current service, if any.
%u = 当前服务的用户名
o %g = primary group name of %u.
%g = %u的用户组名
o %U = session user name (the user name that the
client wanted, not necessarily the same as the one
they got).
%U = 会话用户名(客户端所提供的用户名,不一定与其所实际
取得的用户名一致.) 也就是说,尽管客户端以%U为用户名登录,
服务器在某些设置下,可以把它当成其他用户来处理实际访问
--译注
o %G = primary group name of %U.
%G = %U的用户组名
o %H = the home directory of the user given by %u.
%H = %u所确定的用户的'家'目录
o %v = the Samba version.
%v = Samba的版本
o %h = the internet hostname that Samba is running
on.
%h = 运行Samba的主机的internet主机名
o %m = the NetBIOS name of the client machine (very
useful).
%m = 客户端的NetBIOS协议机器名(非常有用)
o %L = the NetBIOS name of the server. This allows
you to change your config based on what the client
calls you. Your server can have a "dual personal-
ity".
%L = 服务器的NetBIOS协议机器名.这使得你可以根据呼叫你
的客户端来改变你的配置,这样,你的服务器就可以拥有"双重
人格".:-)
o %M = the internet name of the client machine.
%M = 客户端在internet上的机器名
o %N = the name of your NIS home directory server.
This is obtained from your NIS auto.map entry. If
you have not compiled Samba with the --with-auto-
mount option then this value will be the same as
%L.
%N = NIS服务器的名字,它由auto.map得到. 如果没有
用--with-auto-mount选项编译samba,那么它的值和%L相同.
o %p = the path of the service's home directory,
obtained from your NIS auto.map entry. The NIS
auto.map entry is split up as "%N:%p".
%p = 服务的路径。它由NIS的auot.map得到. NIS的auot.map
入口项被分成"%N:%p".
o %R = the selected protocol level after protocol
negotiation. It can be one of CORE, COREPLUS, LAN-
MAN1, LANMAN2 or NT1.
%R = 用来交流的协议,它可以是CORE, COREPLUS,LANMAN1,
LANMAN2或NT1中的一种.
o %d = The process id of the current server process.
%d = 当前samba服务器的进程号
o %a = the architecture of the remote machine. Only
some are recognized, and those may not be 100%
reliable. It currently recognizes Samba, WfWg,
WinNT and Win95. Anything else will be known as
"UNKNOWN". If it gets it wrong then sending a level
3 log to samba-bugs@samba.org should allow it to be
fixed.
%a = 远程主机的结构.现在只能认出来某些类型,并且
这些也不是一定可靠的. 目前能认出来的有Samba,WfWg,
WinNT和Win95. 任何其他的都被认作"UNKNOWN". 如果
出现错误就给samba-bugs@samba.org发一个3级的日志
以便修复这个bug.
o %I = The IP address of the client machine.
%I = 客户端的IP地址.
o %T = the current date and time.
%T = 当前的日期和时间
There are some quite creative things that can be done with
these substitutions and other smb.conf options.
灵活运用这些置换和其他的smb.conf选项可以做出非常有创造性
和有趣的事情来. :)
NAME MANGLING(名称截取)
Samba supports "name mangling" so that DOS and Windows
clients can use files that don't conform to the 8.3 for-
mat. It can also be set to adjust the case of 8.3 format
filenames.
Samba支持"名称截取",这样dos和windows客户端就可以使用与8.3格式
不一致的文件.也可以用来调整8.3格式文件名的大小写.
There are several options that control the way mangling is
performed, and they are grouped here rather than listed
separately. For the defaults look at the output of the
testparm program.
控制名称截取的行为有一些选项, 下面集中列出来. 对于缺省情况
请看testparm程序的输出结果.
All of these options can be set separately for each ser-
vice (or globally, of course).
所有这些选项都可以针对每个服务单独设置(当然也可以设为全局变量)
The options are:
这些选项是:
"mangle case = yes/no" controls if names that have charac-
ters that aren't of the "default" case are mangled. For
example, if this is yes then a name like "Mail" would be
mangled. Default no.
"mangle case = yes/no" 的作用是:如果文件名不是缺省的情况,
Samba是否进行截取.例如,如果设为yes,象"Mail"这样的文件名就
会被截取.缺省设置是no.
"case sensitive = yes/no" controls whether filenames are
case sensitive. If they aren't then Samba must do a file-
name search and match on passed names. Default no.
"case sensitive = yes/no" 控制文件名是否区分大小写. 如果
设为yes,Samba就必须找完全匹配的文件名.缺省设置是no.
"default case = upper/lower" controls what the default
case is for new filenames. Default lower.
"case sensitive = yes/no" 控制文件名是否区分大小写. 如果
设为yes,Samba就必须找完全匹配的文件名.缺省设置是no.
"preserve case = yes/no" controls if new files are created
with the case that the client passes, or if they are
forced to be the "default" case. Default Yes.
"preserve case = yes/no" 用来控制是否保持大小写不变.缺省
为yes.
"short preserve case = yes/no" controls if new files which
conform to 8.3 syntax, that is all in upper case and of
suitable length, are created upper case, or if they are
forced to be the "default" case. This option can be use
with "preserve case = yes" to permit long filenames to
retain their case, while short names are lowered. Default
Yes.
"short preserve case = yes/no" 用来控制符合8.3格式的文件名
是否保持大小写. 比如设为yes的时候,如果所有的字符都是大写,
并且长度合适,那么就生成大写的文件名, 也可以强制设为缺省.
这个"缺省"可以用上面的"preserve case = yes"允许长文件名保
持大小写不变,而短文件名为小写. 本项的缺省设置是Yes.
By default, Samba 2.0 has the same semantics as a Windows
NT server, in that it is case insensitive but case pre-
serving.
缺省情况下,Samba2.0与Windows NT有相同的语义,这样它是不区分
大小写并且保持大小写的.
NOTE ABOUT USERNAME/PASSWORD VALIDATION(用户名/口令确认注意事项)
There are a number of ways in which a user can connect to
a service. The server follows the following steps in
determining if it will allow a connection to a specified
service. If all the steps fail then the connection request
is rejected. If one of the steps pass then the following
steps are not checked.
用户有多种连接到samba服务器的方式.服务器按照下面的步骤来确定
是否允许客户对指定服务的连接.如果
--
"这一千多年没写诗了?"
"写了, 不过只写了两句."
"千年得两句, 一定是万古丽句了. 念来听听."
"好吧, 我现丑了" 太白星清了清嗓子, 浑厚的男中音在天庭响起:
大海啊, 都是水;
骏马啊, 四条腿;
※ 来源:·紫 丁 香 bbs.hit.edu.cn·[FROM: tcpip.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:204.065毫秒