📄 224.html
字号:
<tr><td> </td></tr>
<tr><td align=left><i>作者:</i>王波</td></tr>
<tr><td> </td></tr>
<tr><td><font color=white>除了登录脚本之外,Windows NT中为了支持移动用户在不同地点进行漫游,也提供了针对每个用户的描述其使用环境的Profile文件,Samba服务器也可以通过logon path来支持对windows客户机这种漫游能力的支持。这样当Windows客户机使用漫游功能的时候,客户机会自动将用户的配置文件保存到服务器上,此后每次登录进域的时候都重新下载这个配置文件,设置Windows桌面环境。<br><br># Windows Internet Name Serving Support Section:<br># WINS Support - Tells the NMBD component of Samba to enable it's WINS Server<br>; wins support = yes<br><br># WINS Server - Tells the NMBD components of Samba to be a WINS Client<br># Note: Samba can be either a WINS Server, or a WINS Client, but NOT both<br>; wins server = w.x.y.z<br> <br># WINS Proxy - Tells Samba to answer name resolution queries on<br># behalf of a non WINS capable client, for this to work there must be<br># at least one WINS Server on the network. The default is NO.<br>; wins proxy = yes<br> <br># DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names<br># via DNS nslookups. The built-in default for versions 1.9.17 is yes,<br># this has been changed in version 1.9.18 to no.<br> dns proxy = no<br> <br> <br><br> 上面的这些选项是用于设置NetBIOS名字解析方式,wins support选项使得nmdb能对外表现为一个NBNS服务器。wins server用于指定一个外部名字服务器的地址(可以为NT上的wins服务器或另一个Samba服务器),使得nmbd能用做NBNS客户端,通过访问该wins名字服务器解析NetBIOS名字。 <br><br> 此外,还有一些不使用名字服务器进行解析的NetBIOS客户,如果名字服务器位于另一个子网上,那么它们就无法正确解析名字,而Samba可以使用wins proxy帮助它们使用名字服务器解析地址。例如一个WINS服务器在另一个子网上,本地子网内的Samba服务器配置了wins server的地址,其他Windows客户没有设置wins服务器地址,它们使用b-node广播方式查询名字,在这台Samba服务器设置了wins proxy能力之后,它就能代替wins服务器回应客户请求。因此要用作wins代理,就必须本身能使用名字服务器进行解析,就要求先设置wins server参数。<br><br> 此外,NetBIOS名字解析也可以扩展到通过DNS查询进行帮助,使用dns proxy设置就能让Samba 服务器通过dns进行查询,回应NetBIOS名字查询请求。<br><br><br>[homes]个人目录共享<br><br>#============================ Share Definitions ==============================<br>[homes]<br> comment = Home Directories<br> browseable = no<br> writable = yes<br> <br> <br><br> [homes]部分使得每个Unix用户通过SMB客户登录上来的时候,可以共享使用他自己的个人目录。这个共享资源具备特别属性,当用户登录上之后,共享名就不是homes,而是被服务器映射为用户自己的标识符。<br><br> 设置这个特别的共享选项,就允许每个用户访问自己的个人目录,而不必为每个用户都配置一个共享资源部分。正由于系统会自动映射,因此就不需要定义要共享的文件目录路径,而在其它文件资源共享选项中,都需要使用path参数进行定义。<br><br> 由于Samba系统会自动将homes共享名改变为用户的个人标识符,因此要设定browseable=no ,设置homes本身这个名字不出现在资源列表中。writable为用户写权限设置,由于是在用户的个人目录下,用户可以具备写权限。<br><br><br>[netlogon]与[Profiles]<br><br># Un-comment the following and create the netlogon directory for Domain Logons<br>; [netlogon]<br>; comment = Network Logon Service<br>; path = /usr/local/samba/lib/netlogon<br>; guest ok = yes<br>; writable = no<br>; share modes = no<br> <br> <br><br> 当允许Samba服务器支持客户的网络登录功能之后(设置domain logon),就需要设置[netlogon] 部分(删除注释符号),为guest用户打开登录路径的访问权限,以保证每个用户都能访问其自己的登录脚本。由于需要使用guest对应的Unix帐户访问登录脚本,这个登录路径及其下面的脚本文件都要允许该Unix帐号可以读取。<br><br> 建立这个目录之后,要设定正确的权限,并且创建这个目录下对应各个计算机或用户的登录脚本,以提供给客户正确的登录脚本。<br><br># Un-comment the following to provide a specific roving profile share<br># the default is to use the user's home directory<br>;[Profiles]<br>; path = /usr/local/samba/profiles<br>; browseable = no<br>; guest ok = yes<br> <br> <br><br> 当支持Windows计算机漫游能力时,可以设定[Profiles]部分,并为相应的路径建立目录,及分配权限。来为Window计算机用户设置桌面环境。<br><br><br>[Printers]打印机设置<br><br># NOTE: If you have a BSD-style print system there is no need to<br># specifically define each individual printer<br>[printers]<br> comment = All Printers<br> path = /var/spool/samba<br> browseable = no<br># Set public = yes to allow user 'guest account' to print<br> guest ok = no<br> writable = no<br> printable = yes<br> <br> <br><br> 这个部分就用于设置将printcap中定义的所有打印机使用的相关设置,缺省情况下允许所有的合法客户使用所有的打印机。BSD风格的打印系统,不需要任何设置就能正确共享所有的打印机,当然也可以使用printer参数指定具体的打印机以提供共享。而path参数定义的是打印机缓冲区的位置。guest ok、writeable用于设置正确的权限,而printable用于设置打印属性。<br><br> 由于Windows的打印驱动已经将要打印的文件转化为打印机支持的那种描述语言,因此这些打印文件不再需要任何过滤器进行转换。因此需要在printcap中定义一个不使用任何过滤器、直接将打印文档输出到打印机端口的打印机选项。<br><br><br>其他专有共享目录<br><br># This one is useful for people to share files<br>;[tmp]<br>; comment = Temporary file space<br>; path = /tmp<br>; read only = no<br>; public = yes<br> <br># A publicly accessible directory, but read only, except for people in<br># the "staff" group<br>;[public]<br>; comment = Public Stuff<br>; path = /home/samba<br>; public = yes<br>; writable = yes<br>; printable = no<br>; write list = @staff<br> <br># Other examples.<br>#<br># A private printer, usable only by fred. Spool data will be placed in fred's<br># home directory. Note that fred must have write access to the spool directory,<br># wherever it is.<br>;[fredsprn]<br>; comment = Fred's Printer<br>; valid users = fred<br>; path = /homes/fred<br>; printer = freds_printer<br>; public = no<br>; writable = no<br>; printable = yes<br> <br># A private directory, usable only by fred. Note that fred requires write<br># access to the directory.<br>;[fredsdir]<br>; comment = Fred's Service<br>; path = /usr/somewhere/private<br>; valid users = fred<br>; public = no<br>; writable = yes<br>; printable = no<br> <br># a service which has a different directory for each machine that connects<br># this allows you to tailor configurations to incoming machines. You could<br># also use the %U option to tailor it by user name.<br># The %m gets replaced with the machine name that is connecting.<br>;[pchome]<br>; comment = PC Directories<br>; path = /usr/pc/%m<br>; public = no<br>; writable = yes<br> <br># A publicly accessible directory, read/write to all users. Note that all files<br># created in the directory by users will be owned by the default user, so<br># any user with access can delete any other user's files. Obviously this<br># directory must be writable by the default user. Another user could of course<br># be specified, in which case all files would be owned by that user instead.<br>;[public]<br>; path = /usr/somewhere/else/public<br>; public = yes<br>; only guest = yes<br>; writable = yes<br>; printable = no<br> <br># The following two entries demonstrate how to share a directory so that two<br># users can place files there that will be owned by the specific users. In this<br># setup, the directory should be writable by both users and should have the<br># sticky bit set on it to prevent abuse. Obviously this could be extended to<br># as many users as required.<br>;[myshare]<br>; comment = Mary's and Fred's stuff<br>; path = /usr/somewhere/shared<br>; valid users = mary fred<br>; public = no<br>; writable = yes<br>; printable = no<br>; create mask = 0765<br> <br> <br><br> 此后,缺省smb.conf中给出了一些设定各种共享文件资源、打印机资源的例子,例如设置特定打印机的 [fredprn],设置私人文件共享资源的[freddir]和[myshare],使用宏为多个用户设置共享的[pchome],提供公共访问的[public]和[tmp],FreeBSD的管理员可以根据具体情况,根据这些设置例子设置相应的共享资源,并设置相应的访问权限,以保护文件系统不被非法访问。<br><br> 需要注意的是,当使用valid user用来设置合法访问用户时,或者使用wirte list定义具备写权限的用户时,都可以使用@staff的形式使用Unix的组名,这样凡是属于该staff组成员的用户,都会具备相应权限。<br><br> 从这些例子中可以看到[global]用于设定全局参数,不会出现在资源列表中,[homes]用于设定个人目录共享,其共享的名字映射为个人标识符而非homes,[printers]设定打印机共享,将共享所有的打印机名字,除了这些标题的共享名字与标题不同之外,其他每个标题都将代表一个共享资源的名字。<br><br> 当更改设置之后,可以重新启动Samba服务器,提供新的共享服务了。但在重新启动服务器之前,最好使用 Samba软件包中提供的测试软件,检查一下设置是否正确。这些小工具程序包括检查smb.conf设置的testparm ,检查打印机名字的正确性的程序testprn,用于进行NetBIOS名字解析的nmblookup等。<br><br><br>使用swat配置samba<br><br> samba 2.0提供了一个能够通过浏览器来配置samba的工具──swat。它是一个专用www服务器,使用inetd 来启动,然后经过认证,可以允许用户通过浏览器来配置smb.conf。为了达到这个目的,首先要为swat分配一个固定的端口,这个工作可以通过在/etc/services中增加一行来完成:<br><br>swat 901/tcp<br> <br> <br><br> 出于安全的考虑,应该使用1024以下的端口,这是因为非root用户也能占用1024以上的端口,如果使用 1024之上的端口,可能在某些情况下,普通用户就可能通过欺骗的方法获得管理员的口令。<br><br> 为了启动swat,需要在inetd.conf中增加一个入口,并重起inetd:<br><br>swat stream tcp nowait root /usr/local/sbin/swat swat<br> <br> <br><br> 然后就能使用Netscape等浏览器来配置samba了,为了避免认证口令通过网络传输,应该在本地启动浏览器(并进一步可以使用tcp_wrapper提供保护)。输入URL为:http://localhost:901 /,浏览器将提示用户名和口令对用户进行认证,可以输入任意一个Unix用户进入swat页面,但普通用户只能读取 samba设置,而不能更改,为了设置samba,必须使用root用户进行认证。一些功能简单的浏览器不支持浏览器方式的用户认证,就无法使用swat设置Samba。<br><br> 由于改变smb.conf对于系统安全有严重的影响,因此使用swat一定要小心。为了防止进行swat认证时root密码被窃听,不应该在远程启动浏览器进行设置,应该在控制台或本地安全网络内进行设置。而且一旦设置完毕,应该立即退出浏览器,因为浏览器在内存中保存用户的认证信息,直到浏览器退出。<br><br> 注意,swat将删除原有smb.conf中的全部注释,并重新安排各个设置项的位置,因此应该在使用swat 设置之前备份原有的smb.conf。而且swat只是提供了一个容易使用的设置界面,并不能保证设置一定就是正确的,因此还是要在理解smb.conf的基础上才能正确设置。<br><br> swat提供7个不同功能的页面,提供管理员访问。主页面HOME,提供了对Samba文档的连接,用于管理员实时查看相关手册;GLOBALS页面提供对smb.conf中[globals]部分中的各个参数进行设置;SHARES 用于选择、增加、删除各个共享资源,查看并更改其设置选项;PRINTERS用于设置打印机选项;STATUS 用于检查当前Samba服务器的状态,包括客户计算机的连接状态和用户的连接信息,管理员可以使用它来重新启动 Samba,这样就能在更改设置之后使新设置生效;VIEW用于查看当前设置的smb.conf的内容;PASSWORD 用于管理加密口令,提供加密认证情况下增加和管理用户,并可以保持Unix和Windows NT的口令一致,这个功能只在使用了加密口令功能之后才有用,更改的口令将直接保存在/usr/local/private目录下的smbpasswd 文件中。PASSWORD功能将不但更改smb.conf,还将更改Samba使用的口令选项,因此对于使用加密口令认证方式的系统,最为有用。<br><br> 使用SWAT,设置Samba就非常容易,不再需要手工编辑设置文件,而可以直接使用浏览器更改设置,并重新启动Samba服务器。<br><br>未完,待续。。。 </font></td></tr>
<tr><td> </td></tr>
<tr><td align=right><i>来源:</i><a href="javascript:if(confirm('http://freebsd.online.ha.cn/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://freebsd.online.ha.cn/'" tppabs="http://freebsd.online.ha.cn/">http://freebsd.online.ha.cn/</a></td></tr>
</table>
<p> </p>
<p> </p>
<p> </p>
声明:本站的文章和软件是本人从网上收集整理的(除本人的作品之外),所有版权属于作者,<br>
如有侵犯您的权益,请指出,本站将立即改正,谢谢.
<hr width=500>
<br>
<font color=#ffffff>Copyright 2000 <a href="javascript:if(confirm('http://www.newok.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.newok.com/'" tppabs="http://www.newok.com/" class=t1>www.newok.com</a></font>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -