日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

67 FreeBSD連載:配置samba( 二 )


# this tells Samba to use a separate log file for each machine# that connectslog file = /var/log/log.%m # Put a capping on the size of the log files (in Kb).max log size = 50這里定義samba的日志文件為/var/log目錄下的以log為前綴的文件,%m用于代表從訪問的NetBIOS計(jì)算機(jī)名,如果使用的用戶級認(rèn)證,還可以使用\u表示不同的登錄用戶 。例如從一臺名字為win95c的計(jì)算機(jī)訪問samba服務(wù)器的日志,將記錄在/var/log/log.win95c文件中 。max log size定義每個日志文件的存儲限制 。
# Security mode. Most people will want user level security. See# security_level.txt for details.security = user# Use passWord server option only with security = server;password server = # You may wish to use password encryption. Please read# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.# Do not enable this option unless you have read those documents;encrypt passwords = yes在SMB協(xié)議中,有多個不同的認(rèn)證方式,包括簡單的共享級認(rèn)證和用戶級認(rèn)證 。Unix為多用戶操作系統(tǒng),缺省就使用用戶級認(rèn)證方式 。當(dāng)使用用戶級認(rèn)證的時候,Samba服務(wù)器使用Unix操作系統(tǒng)的用戶和口令(來自/etc/passwd)對用戶進(jìn)行認(rèn)證,這是一種獨(dú)立的認(rèn)證方式 。而有時候希望所有的服務(wù)器使用同一個認(rèn)證數(shù)據(jù)庫進(jìn)行統(tǒng)一認(rèn)證,因此就導(dǎo)致出現(xiàn)了基于域的統(tǒng)一認(rèn)證模式 。在一個域中,用戶只需要通過域控制器進(jìn)行認(rèn)證即可,域中其他SMB服務(wù)器就將認(rèn)可域控制器的認(rèn)證 。
為了使Samba服務(wù)器支持域認(rèn)證方式,可以有兩種不同的設(shè)置方式,一種為真正的域認(rèn)證,另一種為服務(wù)器認(rèn)證方式,將Samba服務(wù)器配置為通過服務(wù)器驗(yàn)證用戶,這需要指定security=server,以及指定passwordserver的名字為NT的域控制器 。認(rèn)證服務(wù)器的方式不能事先域認(rèn)證方式提供的一些特征,但它的適用范圍并不僅限于域,使用工作組的網(wǎng)絡(luò)也能通過統(tǒng)一的認(rèn)證服務(wù)器來使用統(tǒng)一認(rèn)證模式 。設(shè)置域認(rèn)證方式在后面進(jìn)行詳細(xì)解釋 。
在Windows NT 4及Windows 98之后,客戶和服務(wù)器之間進(jìn)行認(rèn)證時,口令不再以明文的方式在網(wǎng)絡(luò)中傳輸了 。為了支持加密口令傳輸,需要設(shè)置encrypt passwords選項(xiàng) 。同樣,這也需要其他復(fù)雜的設(shè)置 。
# Using the following line enables you to customise your configuration# on a per machine basis. The %m gets replaced with the netbios name# of the machine that is connecting;include = /usr/local/etc/smb.conf.%m系統(tǒng)管理員可以為每個特定的計(jì)算機(jī)定制一個特定的配置文件,那里的設(shè)置將覆蓋smb.conf中的缺省設(shè)置 。這樣就可以針對不同的計(jì)算機(jī)提供不同的配置 。
# Most people will find that this option gives better performance.# See speed.txt and the manual pages for detailssocket options = TCP_NODELAYsocket參數(shù)用于配置對TCP的處理方式,以適合Microsoft客戶的特征 。Microsoft習(xí)慣為每個很短的會話都建立單獨(dú)的連接,而不是使用一個連接進(jìn)行多次傳輸,這樣在傳輸中就需要進(jìn)行多次連接會話設(shè)定過程,對性能有一定影響 。為了改善性能,需要設(shè)置TCP_NODELAY或IPTOS_LOWDELAY選項(xiàng) 。
# Configure Samba to use multiple interfaces# If you have multiple network interfaces then you must list them# here. See the man page for details.;interfaces = 192.168.12.2/24 192.168.13.2/24如果計(jì)算機(jī)上有多個網(wǎng)絡(luò)界面,那么就需要讓samba向多個界面廣播b-node廣播包,以及為這些界面提供資源服務(wù),否則samba就會只向某一個界面提供網(wǎng)絡(luò)服務(wù) 。當(dāng)然也可以設(shè)置這個參數(shù),使得samba只服務(wù)于某個指定的網(wǎng)絡(luò),而不是服務(wù)器連接所有的網(wǎng)絡(luò) 。
# Browser Control Options:# set local master to no if you don"t want Samba to become a master# browser on your network. Otherwise the normal election rules apply;local master = no # OS Level determines the precedence of this server in master browser# elections. The default value should be reasonable;os level = 33 # Domain Master specifies Samba to be the Domain Master Browser. This# allows Samba to collate browse lists between subnets. Don"t use this# if you already have a Windows NT domain controller doing this job;domain master = yes # Preferred Master causes Samba to force a local browser election on startup# and gives it a slightly higher chance of winning the election;preferred master = yes# Use only if you have an NT server on your network that has been# configured at install time to be a primary domain controller.;domain controller = 這些設(shè)置選項(xiàng)主要用于SMB網(wǎng)絡(luò)中進(jìn)行瀏覽時,設(shè)置samba服務(wù)器的行為 。缺省情況不讓samba服務(wù)器參加broswser的推舉過程,為了使得samba服務(wù)器能成為browser,就需要設(shè)定local master=yes 。然后samba服務(wù)就可以根據(jù)os level設(shè)置的權(quán)重進(jìn)行推舉,缺省的os level為0,這個權(quán)重不會贏得推舉 。但可以取消注釋,將os level設(shè)置為33,這將在與所有Windows計(jì)算機(jī)(包括Windows NT)的推舉競賽中獲得勝利,因?yàn)镹T server的權(quán)重為32 。設(shè)置比33更高的權(quán)重,只是在不同的samba服務(wù)器之間進(jìn)行選擇時才有意義 。

推薦閱讀