⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 配置samba.htm

📁 Linux下配置samba
💻 HTM
📖 第 1 页 / 共 5 页
字号:
                                省设置。这样就可以针对不同的电脑提供不同的配置。<BR># Most people will 
                                find that this option gives better 
                                performance.<BR># See speed.txt and the manual 
                                pages for details<BR>socket options = 
                                TCP_NODELAY<BR>  socket参数用于配置对TCP的处理方式,以适合Microsoft客户的特征。Microsoft习惯为每个很短 
                                的会话都建立单独的连接,而不是使用一个连接进行多次传输,这样在传输中就需要进行多次连接会话设 
                                定过程,对性能有一定影响。为了改善性能,需要设置TCP_NODELAY或IPTOS_LOWDELAY选项。<BR># 
                                Configure Samba to use multiple interfaces<BR># 
                                If you have multiple network interfaces then you 
                                must list them<BR># here. See the man page for 
                                details.<BR>; interfaces = 192.168.12.2/24 
                                192.168.13.2/24<BR>  如果电脑上有多个网路界面,那么就需要让samba向多个界面广播b-node广播包,以及为这些 
                                界面提供资源服务,否则samba就会只向某一个界面提供网路服务。当然也可以设置这个参数,使得samba 
                                只服务于某个指定的网路,而不是伺服器连接所有的网路。<BR># Browser Control 
                                Options:<BR># set local master to no if you 
                                don't want Samba to become a master<BR># browser 
                                on your network. Otherwise the normal election 
                                rules apply<BR>; local master = no<BR><BR># OS 
                                Level determines the precedence of this server 
                                in master browser<BR># elections. The default 
                                value should be reasonable<BR>; os level = 
                                33<BR><BR># Domain Master specifies Samba to be 
                                the Domain Master Browser. This<BR># allows 
                                Samba to collate browse lists between subnets. 
                                Don't use this<BR># if you already have a 
                                Windows NT domain controller doing this job<BR>; 
                                domain master = yes<BR><BR># Preferred Master 
                                causes Samba to force a local browser election 
                                on startup<BR># and gives it a slightly higher 
                                chance of winning the election<BR>; preferred 
                                master = yes<BR># Use only if you have an NT 
                                server on your network that has been<BR># 
                                configured at install time to be a primary 
                                domain controller.<BR>; domain controller = 
                                &lt;NT-Domain-Controller-SMBName&gt;<BR>  这些设置选项主要用于SMB网路中进行浏览时,设置samba伺服器的行为。预设情况不让samba伺服器参 
                                加broswser的推举过程,为了使得samba伺服器能成为browser,就需要设定local 
                                master =yes。然后samba服务就可以根据os 
                                level设置的权重进行推举,预设的os level为0,这个权重 
                                不会赢得推举。但可以取消注释,将os 
                                level设置为33,这将在与所有Windows电脑(包括Windows NT) 
                                的推举竞赛中获得胜利,因为NT 
                                server的权重为32。设置比33更高的权重,只是在不同的samba 
                                伺服器之间进行选择时才有意义。<BR>  由于Unix及Samba伺服器在同样硬体配置下具有更高的网路性能,因此一般情况下,使用Samba伺服器 
                                作Browser更佳。当然可能在Samba伺服器启动之前,网路中都已经存在了Browser了,一般情况下不必重 
                                新进行推举过程,让网路中的现有Browser继续发挥作用。如果希望Samba伺服器总是成为Browser,可以 
                                设置当Samba伺服器启动时,迫使网路中重新进行推举过程,这需要设定perfered 
                                master参数。<BR>  通常Samba能够胜任master 
                                Browser的角色,然而在多个子网的情况时,网路上就会存在Local master 
                                Browser和Domain master Browser。以上的设置只能使Samba成为 
                                Local master Browser,预设Samba并不参加Domain master 
                                Brower的推举 。设置Samba伺服器成为Domain master 
                                Browser就必须使用domain master参数进 
                                行设置,这对于使用工作组方式进行跨子网浏览意义重大。<BR>  但是如果网路使用的是NT的域方式,就要使用NT的域控制器作为Domain 
                                master Browser 
                                ,不要设置与NT域控制器同一个子网中的Samba伺服器的domain 
                                brower与browser功能,以免它 
                                和域控制器竞争。不让Samba伺服器和NT域控制器竞争的原因是由于Windows 
                                NT中域控制器还涉及域认证( 
                                不是认证域用户,而是认证域上的合法成员电脑),SMB协议中各种复杂功能交错混合,浏览和认证两种不同的功能竟也 
                                混合在一起。由于域控制器完成的域认证任务,Samba伺服器不能够完成,因此为了避免与NT域控制器相互冲突,最好 
                                使用域控制器作Domain master 
                                Browser。<BR>  让Samba伺服器了解目前域中存在的域控制器的方法是指定在设置档案中指定域基本控制器PDC(primary 
                                Domain Controller)的NetBIOS名字,这需要使用domain 
                                controller参 数进行设置。<BR># Enable this if you want 
                                Samba to be a domain logon server for<BR># 
                                Windows95 workstations.<BR>; domain logons = 
                                yes<BR><BR># if you enable domain logons then 
                                you may want a per-machine or<BR># per user 
                                logon script<BR># run a specific logon batch 
                                file per workstation (machine)<BR>; logon script 
                                = %m.bat<BR># run a specific logon batch file 
                                per username<BR>; logon script = %U.bat<BR><BR># 
                                Where to store roving profiles (only for Win95 
                                and WinNT)<BR># %L substitutes for this servers 
                                netbios name, %U is username<BR># You must 
                                uncomment the [Profiles] share below<BR>; logon 
                                path = \%LProfiles\%U<BR>  当用户通过一台Windows 
                                9x客户机使用用户级认证访问网路时,他可以选择登录进网路中的域。这意味着 
                                他不但要在SMB伺服器中进行验证,而且会执行伺服器中相应目录中的登录脚本,以自动执行一些相关设置。通常这种登录 
                                功能是由Windows 
                                NT伺服器来执行的,然而Samba伺服器也能完成这个任务,但必须设定domain logons 
                                参数。此后就可以对不同的客户电脑或不同用户指定相应的登录脚本。这个功能还必须要求在本配置档案后面设置 
                                netlogon共享选项,以便客户机能访问相应的登录脚本。<BR>  除了登录脚本之外,Windows 
                                NT中为了支持移动用户在不同地点进行漫游,也提供了针对每个用户的描述 
                                其使用环境的Profile档案,Samba伺服器也可以通过logon 
                                path来支持对windows客户机这种 
                                漫游能力的支持。这样当Windows客户机使用漫游功能的时候,客户机会自动将用户的配置档案保存到伺服器上,此后 
                                每次登录进域的时候都重新下载这个配置档案,设置Windows桌面环境。<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># 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>  上面的这些选项是用于设置NetBIOS名字解析方式,wins 
                                support选项使得nmdb能对外表现 为一个NBNS伺服器。wins 
                                server用于指定一个外部名字伺服器的地址(可以为NT上的wins伺服器或另 
                                一个Samba伺服器),使得nmbd能用做NBNS客户端,通过访问该wins名字伺服器解析NetBIOS名字。<BR>  此外,还有一些不使用名字伺服器进行解析的NetBIOS客户,如果名字伺服器位于另一个子网上,那么它们就 
                                无法正确解析名字,而Samba可以使用wins 
                                proxy帮助它们使用名字伺服器解析地址。例如一个WINS服务 
                                器在另一个子网上,本地子网内的Samba伺服器配置了wins 
                                server的地址,其他Windows客户没有设 
                                置wins伺服器地址,它们使用b-node广播方式查询名字,在这台Samba伺服器设置了wins 
                                proxy能 
                                力之后,它就能代替wins伺服器回应客户请求。因此要用作wins代理,就必须本身能使用名字伺服器进行解析,就要 
                                求先设置wins 
                                server参数。<BR>  此外,NetBIOS名字解析也可以扩展到通过DNS查询进行帮助,使用dns 
                                proxy设置就能让Samba 
                                伺服器通过dns进行查询,回应NetBIOS名字查询请求。<BR>* 
                                [homes]个人目录共享<BR>#============================ 
                                Share Definitions 
                                ==============================<BR>[homes]<BR>comment 
                                = Home Directories<BR>browseable = 
                                no<BR>writable = 
                                yes<BR>  [homes]部分使得每个Unix用户通过SMB客户登录上来的时候,可以共享使用他自己的个人目录。这个 
                                共享资源具备特别属性,当用户登录上之后,共享名就不是homes,而是被伺服器映射为用户自己的标识符。<BR>  设置这个特别的共享选项,就允许每个用户访问自己的个人目录,而不必为每个用户都配置一个共享资源部分。正由 
                                于系统会自动映射,因此就不需要定义要共享的档案目录路径,而在其它档案资源共享选项中,都需要使用path参数进行 
                                定义。<BR>  由于Samba系统会自动将homes共享名改变为用户的个人标识符,因此要设定browseable=no 
                                ,设置homes本身这个名字不出现在资源列表中。writable为用户写权限设置,由于是在用户的个人目录下,用 
                                户可以具备写权限。<BR>* [netlogon]与[Profiles]<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>  当允许Samba伺服器支持客户的网路登录功能之后(设置domain 
                                logon),就需要设置 
                                [netlogon]部分(删除注释符号),为guest用户打开登录路径的访问权限,以保证每个用户都能访问其自己的登录脚本。由于需要使用guest对应的Unix帐户访问登录脚本,这个登录路径及其下面的脚本档案都要允许该Unix帐号可 
                                以读取。<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>  当支持Windows电脑漫游能力时,可以设定[Profiles]部分,并为相应的路径建立目录,及分配权限。 
                                来为Window电脑用户设置桌面环境。<BR>* [Printers]印表机设置<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>  这个部分就用于设置将printcap中定义的所有印表机使用的相关设置,预设情况下允许所有的合法客户使用 
                                所有的印表机。BSD风格的打印系统,不需要任何设置就能正确共享所有的印表机,当然也可以使用printer参数指 
                                定具体的印表机以提供共享。而path参数定义的是印表机缓冲区的位置。guest 
                                ok、writeable用于设 置正确的权限,而 
                                printable用于设置打印属性。<BR>  由于Windows的打印驱动已经将要打印的档案转化为印表机支持的那种描述语言,因此这些打印档案不再需要 
                                任何过滤器进行转换。因此需要在printcap中定义一个不使用任何过滤器、直接将打印文档输出到印表机端口的打印 
                                机选项。<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 = 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -