.\" -*- nroff -*- .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "SMB.CONF" 5 "" "" "" .SH NAME smb.conf \- Samba元件的配置檔案 .SH "總覽 SYNOPSIS" .PP \fIsmb.conf\fR是Samba元件的配置檔案,包含Samba程式執行時的配置信 息.\fIsmb.conf\fR被設計成可由\fBswat\fR (8)程式來配置和管理.本檔案包含了 關於smb.conf的檔案格式和可能出現的選項的完整描述以供參考. .SH "檔案格式 FILE FORMAT" .PP 本檔案由一系列段和選項構成.一個段由一對方括號中的段名開始,直到下一個段名結束.包含在段中的選項按以下格式定義: .PP \fI選項名\fR = \fI選項值\fR .PP 本檔案是基於文字行的.這就是說,每一個以換行符結束的行描述了一個專案(註釋,段名,或選項). .PP 段名和選項名是不區分大小寫的. .PP 只有選項設定中的第一個等號才有意義.第一個等號前後的空格會被忽略.段名和選項名的前後以及中間包含的空格是無關的.選項值前後的空格會被忽略.選項值中包含的空格會原樣保留. .PP 所有以';'和'#'符開頭的行都會被忽略,就象只有空格的行那樣. .PP 按照UNIX上的慣例,以'\'符號結尾的行續下一行.(也就是說:'\'是續行符,如果一行寫不下,可以在行尾以'\'結束,在下一行繼續寫--譯註) .PP 等號後面跟的是字串(無需引號)或者邏輯值(可以是yes/no,1/0,或者true/false 來表示).邏輯值是不區分大小寫的.字串值則原樣保留了輸入的大小寫.某些選項 (例如create modes)的值是數值型的. .SH "段描述 SECTION DESCRIPTIONS" .PP 配置檔案的每一段([global]段除外)描述一項共享資源.段名就是共享名,段內的選項設定確定了該共享資源的屬性. .PP 三個特殊段([global],[homes],[printers])將在後面'special sections'單獨說明,以下的內容是普通段的說明. .PP 一個共享資源由一個檔案目錄和使用者對此目錄的操作許可權的說明構成.另外,還列入了一些用於內部管理的選項. .PP 每一段定義了一項檔案服務(客戶端可以把它看作其本機檔案系統的延伸)或列印服務(客戶端可以透過它來使用伺服器提供的列印服務). .PP 段可以定義成\fBguest\fR服務型別,在這種情況下,客戶無需口令就可以訪問該資源.一個特定的UNIX系統下的\fBguest account\fR通常用來指定這種情況下的客戶訪問許可權. .PP 除了guest服務型別以外,其他型別的段定義的共享資源都需要口令才能訪問.使用者名稱是由客戶端提供的.由於某些老的客戶端只提供口令,沒有使用者名稱,你需要在共享定義中使用"user="選項來指定一個使用者列表,以便根據這個使用者列表進行口令驗證.對於象Windos95/98和WindowsNT這樣的現代客戶端程式,這個選項是不需要的. .PP 注意,對於資源的操作許可權還取決於主機系統賦予指定使用者或來訪者賬戶的許可權.samba提供的服務許可權不能超出主機系統指定的許可權範圍. .PP 下面的示範段定義了一項檔案服務,使用者擁有對\fI/home/bar\fR目錄進行寫操作的許可權.這個共享資源是透過共享名"foo"來訪問的. .nf [foo] path = /home/bar read only = no .fi .PP 下面示範段定義了一項列印服務,此共享資源是隻讀的,但是可以進行列印操作.也就是說,唯一允許的寫操作只能是開啟、寫入並關閉一個列印假離線檔案.其中的\fIguest ok\fR選項定義意味著允許以預設的guest使用者(在別處定義的)許可權進行訪問. .nf [aprinter] path = /usr/spool/public read only = yes printable = yes guest ok = yes .fi .SH "特殊段 SPECIAL SECTIONS" .SS "[global] 全域性選項段 " .PP 這一段中定義的選項是伺服器的全域性性設定,如果在其他段中沒有再對這些選項進行重新設定的話還可以作為它們的預設選項.更多的說明請參閱'PARAMETERS'部分的內容. .SS "[homes] 個人目錄段" .PP 如果配置檔案中包含名為'homes'的段,就可以建立客戶到自己在伺服器上的個人目錄的連線. .PP 當伺服器收到連線請求時,首先在已定義的段中搜索,如果段名與被請求的共享資源名一致,則該段的內容就被採用.如果沒有找到匹配的段,則被請求的資源就被當作是一個使用者名稱,同時伺服器檢視本地的口令檔案.如果該使用者名稱在口令檔案中存在且使用者給出了正確的口令,伺服器就會複製[homes]段的內容來生成一個共享資源(供該使用者訪問). .PP 對新建共享會做以下修改: .TP 3 共享名從'homes'改為查到的使用者名稱. .TP 如果沒有指定訪問路徑,則設定為該使用者的個人目錄. .LP .PP 如果要在[homes]段中定義訪問路徑\fBpath=\fR,宏%S也許對你很有用.舉例如下: .PP \fBpath = /data/pchome/%S\fR .PP 如果你的PC 有與UNIX伺服器上個人目錄不同的目錄,象上面這樣的設定會很有用的. .PP 這是為大量使用者提供對他們個人目錄的訪問的一種快速簡潔的辦法. .PP 如果被請求訪問的共享資源名就是'homes',那麼,除了共享名不被改變為發出請求的使用者名稱外,其他處理過程和前面提到的過程是類似的.這種方式適合於不同使用者共享一臺終端的情況. .PP 在[homes]段中可以定義所有普通段中可以使用的選項,可是有些選項更有意義.下面是一個實用的、典型的[homes]段的例子: .nf [homes] read only = no .fi .PP 注意,很重要的一點是:如果在[homes]段中定義了允許以guest賬戶訪問的話,任何人都可以\fB無須口令\fR而訪問所有賬戶的宿主目錄.也許在某些特殊情況下,這正是想要的結果,在這種情況下,你最好同時把[homes]段設定成\fB只讀\fR. .PP 注意,自動的宿主目錄共享資源的\fB可瀏覽\fR標誌是從[global]段繼承來的,而不是[homes]段.這樣,當在[homes]段中設定\fRbrowseable=no\fR時,使用者就看不到單獨的'homes'共享,但可以看到自動的宿主目錄. .SS "[printers] 印表機共享設定段" .PP 這一段很象[homes]段,不過是用於設定共享印表機的. .PP 如果在本配置檔案中存在[printers]段,使用者就可以連線到在主機上的printcap檔案 中指定的任一印表機. .PP 當伺服器收到連線請求時,首先在已定義的段中搜索,如果有段名與被請求的共享資源名一致,則該段的內容就被採用.如果沒有找到匹配的段,且在配置檔案中存在[homes]段,則按照前面所說的方式處理.否則,被請求的資源就被當作是一個印表機名,伺服器在適當的printcap檔案中查詢,檢驗被請求的共享資源名是否是有效的印表機共享名.如果共享名匹配,伺服器就會複製[printers]段的內容來生成一個共享列印服務. .PP 對新建共享的修改: .TP 3 共享名被設定為查詢到的印表機名. .TP 如果未給出印表機名,則把印表機名設為前面查詢到的印表機名. .TP 如果該共享資源不允許以guest身份進行訪問,且沒有給出使用者名稱,那麼使用者名稱就被設為前面查詢到的印表機名. .LP .PP 注意,[printers]段必須設定為可列印,如果你不這樣設定,伺服器會拒絕裝載配置檔案. .PP 指定的典型路徑應該設為一個公用的可寫假離線目錄(spooling)並且設定sticky標誌.一個典型的[printers]段如下所示: .nf [printers] path = /usr/spool/public guest ok = yes printable = yes .fi .PP 上臺印表機在printcap檔案中列出的所有別名都是伺服器相關的有效印表機名.如果你係統的列印子系統的工作方式不是這樣,你就必須設定一個偽printcap檔案,其中包含一行或多行如下格式的設定: .nf 別名1|別名2|別名3|別名4... .fi .PP 每個別名必須是你的列印子系統可以接受的印表機名.在[global]段中指定這個新檔案作為你的printcap檔案.這個偽printcap檔案可以包含任何你要的別名,而伺服器只識別在此檔案中列出的名字.這個技術可以很方便的用於限制對本地印表機子集的訪問. .PP 順便提一下,printcap檔案中的別名用每個記錄第一項的任何部分來定義.記錄由換行進行分隔.如果一條記錄中有多個部分,中間用"|"符號分隔. .RS .Sh "Note" .PP 注意,在SYSV系統中,用lpstat可以確定系統中安裝了什麼樣的印表機.你可以設定"printcap name = lpstat"來自動獲得印表機列表.詳情參見"printcap name"選項. .RE .SH "選項 PARAMETERS" .PP 選項定義了每個段的屬性. .PP 有些選項是在[global]段中設定的(比如有關\fB安全\fR特性的設定),有些可以用在任何段中的(比如\fB建立方式\fR ),剩下的就只能用在普通的段中了.在以下的描述中,[homes]和[printers]段被看作是普通段.標記(\fBG\fR)表示此選項只能在[global]段中使用,標記(\fBS\fR)表示此選項可以在服務定義段中使用.注意,有(\fBS\fR)標記的選項也可以用在[global]段中,在這種情況下,這個選項設定被當作所有其他段的預設設定. .PP 選項的詳細說明是按照字母順序排列的,這樣也許不是最好的分類方式,但至少保證你可以找得到他們.如果有多個同義詞,那麼我們只對首選的那個作詳細說明,其他的同義詞都只指明參閱那個首選的選項名. .SH "變數替換 VARIABLE SUBSTITUTIONS" .PP 在配置檔案中可以用很多字串進行替換.例如,當用戶以john的名稱建立連線後,選項"path = /tmp/%u"就被解釋成"path = /tmp/john". .PP 這些置換會在後面的描述中說明,這裡說明一些可以用在任何地方的通用置換.它們是: .TP %U 對話使用者名稱(客戶端想要的使用者名稱不一定與取得的一致.) .TP %G %U的使用者組名 .TP %h 執行Samba的主機的internet主機名 .TP %m 客戶機的NetBIOS名(非常有用) .TP %L 伺服器的NetBIOS名.這使得你可以根據呼叫的客戶端來改變你的配置,這樣你的伺服器就可以擁有"雙重個性". Note that this parameter is not available when Samba listens on port 445, as clients no longer send this information .TP %M 客戶端的internet主機名 .TP %R 協議協商後選擇的協議,它可以是CORE,COREPLUS,LANMAN1,LANMAN2或NT1中的一種. .TP %d 當前samba伺服器的程序號. .TP %a 遠端主機的結構.現在只能認出來某些型別,並且不是100%可靠.目前支援的有Samba、WfWg、WinNT和Win95.任何其他的都被認作"UNKNOWN".如果出現錯誤就給samba-bugs@samba.org發一個3級的日誌以便修復這個bug. .TP %I 客戶機的IP地址. .TP %T 當前的日期和時間. .TP %D Name of the domain or workgroup of the current user\&. .TP %$(\fIenvvar\fR) The value of the environment variable \fIenvar\fR\&. .PP The following substitutes apply only to some configuration options(only those that are used when a connection has been established): .TP %S 當前服務名 .TP %P 當前服務的根目錄 .TP %u 當前服務的使用者名稱 .TP %g %u的使用者組名 .TP %H %u所表示的使用者的宿主目錄 .TP %N tNIS伺服器的名字.它從auto.map獲得.如果沒有用\fB--with-auto-mount\fR選項編譯samba,那麼它的值和%L相同. .TP %p 使用者宿主目錄的路徑.它由NIS的auot.map得到.NIS的auot.map入口項被分為"%N:%p". .PP 靈活運用這些置換和其他的smb.conf選項可以做出非常有創造性的事情來. .SH NAME .PP Samba支援"名稱修正",這樣dos和windows客戶端就可以使用與8.3格式不一致的檔案.也可以用來調整8.3格式檔名的大小寫. .PP 有一些選項可以控制名稱修正的執行,下面集中列出來.對於預設情況請看testparm程式的輸出結果. .PP 所有這些選項都可以針對每個服務項單獨設定(當然也可以設為全域性變數). .PP 這些選項是: .TP mangle case = yes/no 作用是控制是否對不符合預設寫法的名稱進行修正.例如,如果設為yes,象"Mail"這樣的檔名就會被修正.預設設定是\fBno\fR. .TP case sensitive = yes/no 控制檔名是否區分大小寫.如果不區分的話,Samba就必須在傳遞名稱時查詢並匹配檔名.預設設定是\fBno\fR. .TP default case = upper/lower 控制新檔名大小寫預設值.預設設定是\fB小寫\fR. .TP preserve case = yes/no 控制建新檔案時是否用客戶所提供的大小寫形式,或強制用預設形式.預設為\fByes\fR. .TP short preserve case = yes/no 控制新建8.3格式的檔名時是全部用大寫及合適長度,還是強制用預設情況.它可以和上面的"preserve case = yes"聯用以允許長檔名保持大小寫不變,而短檔名為小寫.本項的預設設定是\fByes\fR. .PP 預設情況下,Samba3.0與Windows NT相同,就是不區分大小寫但保持大小寫形式. .SH "使用者名稱/口令檢驗中的注意事項 NOTE ABOUT USERNAME/PASSWORD VALIDATION" .PP 使用者有多種連線到服務項的方式.伺服器按照下面的步驟來確定是否允許客戶對指定服務的連線.如果下面步驟全部失敗,則拒絕使用者的連線請求.如果某一步透過,餘下的檢驗就不再進行. .PP 如果被請求的服務項設定為\fIguest only = yes\fR,並且,服務執行在共享級安全模式(\fIsecurity = share\fR) ,則跳過1--5步檢查. .TP 3 第一步: 如果客戶端提供一對使用者名稱和口令,且這對使用者名稱和口令經unix系統口令程式檢驗為有效,那麼就以該使用者名稱建立連線.注意,這包括用\fI\\\\server\\service%username\fR方式傳遞使用者名稱. .TP 第二步: 如果客戶端事先在系統上註冊了一個使用者名稱,並且提供了正確的口令,就允許建立連線. .TP 第三步: 根據提供的口令檢查客戶端的netbios名及以前用過的使用者名稱,如匹配,就允許以該使用者名稱建立連線. .TP 第四步: 如果客戶端以前有合法的使用者名稱和口令,並獲得了有效的令牌,就允許以該使用者名稱建立連線. .TP 第五步: 如果在\fIsmb.conf\fR裡設定了"user = "欄位,且客戶端提供了一個口令,口令經UNIX系統檢驗,並與"user="欄位裡某一個使用者匹配,那麼就允許以"user="裡匹配到的使用者名稱建立連線.如果"user="欄位是以@開始,那麼該名字會展開為同名組裡的使用者名稱列表 . .TP 第六步: 如果這是一個提供給guest用的服務項,那麼連線以"guest account ="裡給出的使用者名稱建立,而不考慮提供的口令. .LP .SH "全域性選項完整列表 COMPLETE LIST OF GLOBAL PARAMETERS" .PP 以下列出了所有的全域性選項,各選項的詳細說明請參看後面的相應段落.注意,有些選項的意義是相同的. .TP 3 \(bu \fIabort shutdown script\fR .TP \(bu \fIadd group script\fR .TP \(bu \fIadd machine script\fR .TP \(bu \fIaddprinter command\fR .TP \(bu \fIadd share command\fR .TP \(bu \fIadd user script\fR .TP \(bu \fIadd user to group script\fR .TP \(bu \fIafs username map\fR .TP \(bu \fIalgorithmic rid base\fR .TP \(bu \fIallow trusted domains\fR .TP \(bu \fIannounce as\fR .TP \(bu \fIannounce version\fR .TP \(bu \fIauth methods\fR .TP \(bu \fIauto services\fR .TP \(bu \fIbind interfaces only\fR .TP \(bu \fIbrowse list\fR .TP \(bu \fIchange notify timeout\fR .TP \(bu \fIchange share command\fR .TP \(bu \fIclient lanman auth\fR .TP \(bu \fIclient ntlmv2 auth\fR .TP \(bu \fIclient plaintext auth\fR .TP \(bu \fIclient schannel\fR .TP \(bu \fIclient signing\fR .TP \(bu \fIclient use spnego\fR .TP \(bu \fIconfig file\fR .TP \(bu \fIdeadtime\fR .TP \(bu \fIdebug hires timestamp\fR .TP \(bu \fIdebuglevel\fR .TP \(bu \fIdebug pid\fR .TP \(bu \fIdebug timestamp\fR .TP \(bu \fIdebug uid\fR .TP \(bu \fIdefault\fR .TP \(bu \fIdefault service\fR .TP \(bu \fIdelete group script\fR .TP \(bu \fIdeleteprinter command\fR .TP \(bu \fIdelete share command\fR .TP \(bu \fIdelete user from group script\fR .TP \(bu \fIdelete user script\fR .TP \(bu \fIdfree command\fR .TP \(bu \fIdisable netbios\fR .TP \(bu \fIdisable spoolss\fR .TP \(bu \fIdisplay charset\fR .TP \(bu \fIdns proxy\fR .TP \(bu \fIdomain logons\fR .TP \(bu \fIdomain master\fR .TP \(bu \fIdos charset\fR .TP \(bu \fIenable rid algorithm\fR .TP \(bu \fIencrypt passwords\fR .TP \(bu \fIenhanced browsing\fR .TP \(bu \fIenumports command\fR .TP \(bu \fIget quota command\fR .TP \(bu \fIgetwd cache\fR .TP \(bu \fIguest account\fR .TP \(bu \fIhide local users\fR .TP \(bu \fIhomedir map\fR .TP \(bu \fIhost msdfs\fR .TP \(bu \fIhostname lookups\fR .TP \(bu \fIhosts equiv\fR .TP \(bu \fIidmap backend\fR .TP \(bu \fIidmap gid\fR .TP \(bu \fIidmap uid\fR .TP \(bu \fIinclude\fR .TP \(bu \fIinterfaces\fR .TP \(bu \fIkeepalive\fR .TP \(bu \fIkernel change notify\fR .TP \(bu \fIkernel oplocks\fR .TP \(bu \fIlanman auth\fR .TP \(bu \fIlarge readwrite\fR .TP \(bu \fIldap admin dn\fR .TP \(bu \fIldap delete dn\fR .TP \(bu \fIldap filter\fR .TP \(bu \fIldap group suffix\fR .TP \(bu \fIldap idmap suffix\fR .TP \(bu \fIldap machine suffix\fR .TP \(bu \fIldap passwd sync\fR .TP \(bu \fIldap port\fR .TP \(bu \fIldap server\fR .TP \(bu \fIldap ssl\fR .TP \(bu \fIldap suffix\fR .TP \(bu \fIldap user suffix\fR .TP \(bu \fIlm announce\fR .TP \(bu \fIlm interval\fR .TP \(bu \fIload printers\fR .TP \(bu \fIlocal master\fR .TP \(bu \fIlock dir\fR .TP \(bu \fIlock directory\fR .TP \(bu \fIlock spin count\fR .TP \(bu \fIlock spin time\fR .TP \(bu \fIlog file\fR .TP \(bu \fIlog level\fR .TP \(bu \fIlogon drive\fR .TP \(bu \fIlogon home\fR .TP \(bu \fIlogon path\fR .TP \(bu \fIlogon script\fR .TP \(bu \fIlpq cache time\fR .TP \(bu \fImachine password timeout\fR .TP \(bu \fImangled stack\fR .TP \(bu \fImangle prefix\fR .TP \(bu \fImangling method\fR .TP \(bu \fImap to guest\fR .TP \(bu \fImax disk size\fR .TP \(bu \fImax log size\fR .TP \(bu \fImax mux\fR .TP \(bu \fImax open files\fR .TP \(bu \fImax protocol\fR .TP \(bu \fImax smbd processes\fR .TP \(bu \fImax ttl\fR .TP \(bu \fImax wins ttl\fR .TP \(bu \fImax xmit\fR .TP \(bu \fImessage command\fR .TP \(bu \fImin passwd length\fR .TP \(bu \fImin password length\fR .TP \(bu \fImin protocol\fR .TP \(bu \fImin wins ttl\fR .TP \(bu \fIname cache timeout\fR .TP \(bu \fIname resolve order\fR .TP \(bu \fInetbios aliases\fR .TP \(bu \fInetbios name\fR .TP \(bu \fInetbios scope\fR .TP \(bu \fInis homedir\fR .TP \(bu \fIntlm auth\fR .TP \(bu \fInt pipe support\fR .TP \(bu \fInt status support\fR .TP \(bu \fInull passwords\fR .TP \(bu \fIobey pam restrictions\fR .TP \(bu \fIoplock break wait time\fR .TP \(bu \fIos2 driver map\fR .TP \(bu \fIos level\fR .TP \(bu \fIpam password change\fR .TP \(bu \fIpanic action\fR .TP \(bu \fIparanoid server security\fR .TP \(bu \fIpassdb backend\fR .TP \(bu \fIpasswd chat\fR .TP \(bu \fIpasswd chat debug\fR .TP \(bu \fIpasswd program\fR .TP \(bu \fIpassword level\fR .TP \(bu \fIpassword server\fR .TP \(bu \fIpid directory\fR .TP \(bu \fIprefered master\fR .TP \(bu \fIpreferred master\fR .TP \(bu \fIpreload\fR .TP \(bu \fIpreload modules\fR .TP \(bu \fIprintcap\fR .TP \(bu \fIprivate dir\fR .TP \(bu \fIprotocol\fR .TP \(bu \fIread bmpx\fR .TP \(bu \fIread raw\fR .TP \(bu \fIread size\fR .TP \(bu \fIrealm\fR .TP \(bu \fIremote announce\fR .TP \(bu \fIremote browse sync\fR .TP \(bu \fIrestrict anonymous\fR .TP \(bu \fIroot\fR .TP \(bu \fIroot dir\fR .TP \(bu \fIroot directory\fR .TP \(bu \fIsecurity\fR .TP \(bu \fIserver schannel\fR .TP \(bu \fIserver signing\fR .TP \(bu \fIserver string\fR .TP \(bu \fIset primary group script\fR .TP \(bu \fIset quota command\fR .TP \(bu \fIshow add printer wizard\fR .TP \(bu \fIshutdown script\fR .TP \(bu \fIsmb passwd file\fR .TP \(bu \fIsmb ports\fR .TP \(bu \fIsocket address\fR .TP \(bu \fIsocket options\fR .TP \(bu \fIsource environment\fR .TP \(bu \fIstat cache\fR .TP \(bu \fIsyslog\fR .TP \(bu \fIsyslog only\fR .TP \(bu \fItemplate homedir\fR .TP \(bu \fItemplate primary group\fR .TP \(bu \fItemplate shell\fR .TP \(bu \fItime offset\fR .TP \(bu \fItime server\fR .TP \(bu \fItimestamp logs\fR .TP \(bu \fIunicode\fR .TP \(bu \fIunix charset\fR .TP \(bu \fIunix extensions\fR .TP \(bu \fIunix password sync\fR .TP \(bu \fIupdate encrypted\fR .TP \(bu \fIuse mmap\fR .TP \(bu \fIusername level\fR .TP \(bu \fIusername map\fR .TP \(bu \fIuse spnego\fR .TP \(bu \fIutmp\fR .TP \(bu \fIutmp directory\fR .TP \(bu \fIwinbind cache time\fR .TP \(bu \fIwinbind enable local accounts\fR .TP \(bu \fIwinbind enum groups\fR .TP \(bu \fIwinbind enum users\fR .TP \(bu \fIwinbind gid\fR .TP \(bu \fIwinbind separator\fR .TP \(bu \fIwinbind trusted domains only\fR .TP \(bu \fIwinbind uid\fR .TP \(bu \fIwinbind use default domain\fR .TP \(bu \fIwins hook\fR .TP \(bu \fIwins partners\fR .TP \(bu \fIwins proxy\fR .TP \(bu \fIwins server\fR .TP \(bu \fIwins support\fR .TP \(bu \fIworkgroup\fR .TP \(bu \fIwrite raw\fR .TP \(bu \fIwtmp directory\fR .LP .SH "服務選項完整列表 COMPLETE LIST OF SERVICE PARAMETERS" .PP 以下列出了所有關於服務項的選項,各選項的詳細說明請參見後面的相應段落.注意,有些選項的意義是相同的. .TP 3 \(bu \fIacl compatibility\fR .TP \(bu \fIadmin users\fR .TP \(bu \fIafs share\fR .TP \(bu \fIallow hosts\fR .TP \(bu \fIavailable\fR .TP \(bu \fIblocking locks\fR .TP \(bu \fIblock size\fR .TP \(bu \fIbrowsable\fR .TP \(bu \fIbrowseable\fR .TP \(bu \fIcase sensitive\fR .TP \(bu \fIcasesignames\fR .TP \(bu \fIcomment\fR .TP \(bu \fIcopy\fR .TP \(bu \fIcreate mask\fR .TP \(bu \fIcreate mode\fR .TP \(bu \fIcsc policy\fR .TP \(bu \fIdefault case\fR .TP \(bu \fIdefault devmode\fR .TP \(bu \fIdelete readonly\fR .TP \(bu \fIdelete veto files\fR .TP \(bu \fIdeny hosts\fR .TP \(bu \fIdirectory\fR .TP \(bu \fIdirectory mask\fR .TP \(bu \fIdirectory mode\fR .TP \(bu \fIdirectory security mask\fR .TP \(bu \fIdont descend\fR .TP \(bu \fIdos filemode\fR .TP \(bu \fIdos filetime resolution\fR .TP \(bu \fIdos filetimes\fR .TP \(bu \fIexec\fR .TP \(bu \fIfake directory create times\fR .TP \(bu \fIfake oplocks\fR .TP \(bu \fIfollow symlinks\fR .TP \(bu \fIforce create mode\fR .TP \(bu \fIforce directory mode\fR .TP \(bu \fIforce directory security mode\fR .TP \(bu \fIforce group\fR .TP \(bu \fIforce security mode\fR .TP \(bu \fIforce user\fR .TP \(bu \fIfstype\fR .TP \(bu \fIgroup\fR .TP \(bu \fIguest account\fR .TP \(bu \fIguest ok\fR .TP \(bu \fIguest only\fR .TP \(bu \fIhide dot files\fR .TP \(bu \fIhide files\fR .TP \(bu \fIhide special files\fR .TP \(bu \fIhide unreadable\fR .TP \(bu \fIhide unwriteable files\fR .TP \(bu \fIhosts allow\fR .TP \(bu \fIhosts deny\fR .TP \(bu \fIinherit acls\fR .TP \(bu \fIinherit permissions\fR .TP \(bu \fIinvalid users\fR .TP \(bu \fIlevel2 oplocks\fR .TP \(bu \fIlocking\fR .TP \(bu \fIlppause command\fR .TP \(bu \fIlpq command\fR .TP \(bu \fIlpresume command\fR .TP \(bu \fIlprm command\fR .TP \(bu \fImagic output\fR .TP \(bu \fImagic script\fR .TP \(bu \fImangle case\fR .TP \(bu \fImangled map\fR .TP \(bu \fImangled names\fR .TP \(bu \fImangling char\fR .TP \(bu \fImap acl inherit\fR .TP \(bu \fImap archive\fR .TP \(bu \fImap hidden\fR .TP \(bu \fImap system\fR .TP \(bu \fImax connections\fR .TP \(bu \fImax print jobs\fR .TP \(bu \fImax reported print jobs\fR .TP \(bu \fImin print space\fR .TP \(bu \fImsdfs proxy\fR .TP \(bu \fImsdfs root\fR .TP \(bu \fInt acl support\fR .TP \(bu \fIonly guest\fR .TP \(bu \fIonly user\fR .TP \(bu \fIoplock contention limit\fR .TP \(bu \fIoplocks\fR .TP \(bu \fIpath\fR .TP \(bu \fIposix locking\fR .TP \(bu \fIpostexec\fR .TP \(bu \fIpreexec\fR .TP \(bu \fIpreexec close\fR .TP \(bu \fIpreserve case\fR .TP \(bu \fIprintable\fR .TP \(bu \fIprintcap name\fR .TP \(bu \fIprint command\fR .TP \(bu \fIprinter\fR .TP \(bu \fIprinter admin\fR .TP \(bu \fIprinter name\fR .TP \(bu \fIprinting\fR .TP \(bu \fIprint ok\fR .TP \(bu \fIprofile acls\fR .TP \(bu \fIpublic\fR .TP \(bu \fIqueuepause command\fR .TP \(bu \fIqueueresume command\fR .TP \(bu \fIread list\fR .TP \(bu \fIread only\fR .TP \(bu \fIroot postexec\fR .TP \(bu \fIroot preexec\fR .TP \(bu \fIroot preexec close\fR .TP \(bu \fIsecurity mask\fR .TP \(bu \fIset directory\fR .TP \(bu \fIshare modes\fR .TP \(bu \fIshort preserve case\fR .TP \(bu \fIstrict allocate\fR .TP \(bu \fIstrict locking\fR .TP \(bu \fIstrict sync\fR .TP \(bu \fIsync always\fR .TP \(bu \fIuse client driver\fR .TP \(bu \fIuser\fR .TP \(bu \fIusername\fR .TP \(bu \fIusers\fR .TP \(bu \fIuse sendfile\fR .TP \(bu \fI-valid\fR .TP \(bu \fIvalid users\fR .TP \(bu \fIveto files\fR .TP \(bu \fIveto oplock files\fR .TP \(bu \fIvfs object\fR .TP \(bu \fIvfs objects\fR .TP \(bu \fIvolume\fR .TP \(bu \fIwide links\fR .TP \(bu \fIwritable\fR .TP \(bu \fIwriteable\fR .TP \(bu \fIwrite cache size\fR .TP \(bu \fIwrite list\fR .TP \(bu \fIwrite ok\fR .LP .SH "每一個選項的詳細解釋 EXPLANATION OF EACH PARAMETER" .TP abort shutdown script (G) \fBThis parameter only exists in the HEAD cvs branch\fR This a full path name to a script called by \fBsmbd\fR(8) that should stop a shutdown procedure issued by the \fIshutdown script\fR\&. This command will be run as user\&. 預設設定: \fBNone\fR\&. 示例: \fBabort shutdown script = /sbin/shutdown -c\fR .TP acl compatibility (S) This parameter specifies what OS ACL semantics should be compatible with\&. Possible values are \fBwinnt\fR for Windows NT 4, \fBwin2k\fR for Windows 2000 and above and \fBauto\fR\&. If you specify \fBauto\fR, the value for this parameter will be based upon the version of the client\&. There should be no reason to change this parameter from the default\&. 預設設定: \fBacl compatibility = Auto\fR 示例: \fBacl compatibility = win2k\fR .TP add group script (G) This is the full pathname to a script that will be run \fBAS ROOT\fR by \fBsmbd\fR(8) when a new group is requested\&. It will expand any \fI%g\fR to the group name passed\&. This script is only useful for installations using the Windows NT domain administration tools\&. The script is free to create a group with an arbitrary name to circumvent unix group name restrictions\&. In that case the script must print the numeric gid of the created group on stdout\&. .TP add machine script (G) This is the full pathname to a script that will be run by \fBsmbd\fR(8) when a machine is added to it's domain using the administrator username and password method\&. This option is only required when using sam back-ends tied to the Unix uid method of RID calculation such as smbpasswd\&. This option is only available in Samba 3\&.0\&. 預設設定: \fBadd machine script = <空字串>\fR 示例: \fBadd machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u\fR .TP addprinter command (G) With the introduction of MS-RPC based printing support for Windows NT/2000 clients in Samba 2\&.2, The MS Add Printer Wizard (APW) icon is now also available in the "Printers\&.\&.\&." folder displayed a share listing\&. The APW allows for printers to be add remotely to a Samba or Windows NT/2000 print server\&. For a Samba host this means that the printer must be physically added to the underlying printing system\&. The \fIadd printer command\fR defines a script to be run which will perform the necessary operations for adding the printer to the print system and to add the appropriate service definition to the \fIsmb\&.conf\fR file in order that it can be shared by \fBsmbd\fR(8)\&. The \fIaddprinter command\fR is automatically invoked with the following parameter (in order): \fIprinter name\fR \fIshare name\fR \fIport name\fR \fIdriver name\fR \fIlocation\fR \fIWindows 9x driver location\fR All parameters are filled in from the PRINTER_INFO_2 structure sent by the Windows NT/2000 client with one exception\&. The "Windows 9x driver location" parameter is included for backwards compatibility only\&. The remaining fields in the structure are generated from answers to the APW questions\&. Once the \fIaddprinter command\fR has been executed, \fBsmbd\fR will reparse the \fI smb\&.conf\fR to determine if the share defined by the APW exists\&. If the sharename is still invalid, then \fBsmbd \fR will return an ACCESS_DENIED error to the client\&. The "add printer command" program can output a single line of text, which Samba will set as the port the new printer is connected to\&. If this line isn't output, Samba won't reload its printer shares\&. 參見 \fI deleteprinter command\fR, \fIprinting\fR, \fIshow add printer wizard\fR 預設設定: \fBnone\fR 示例: \fBaddprinter command = /usr/bin/addprinter\fR .TP add share command (G) Samba 2\&.2\&.0 introduced the ability to dynamically add and delete shares via the Windows NT 4\&.0 Server Manager\&. The \fIadd share command\fR is used to define an external program or script which will add a new service definition to \fIsmb\&.conf\fR\&. In order to successfully execute the \fIadd share command\fR, \fBsmbd\fR requires that the administrator be connected using a root account (i\&.e\&. uid == 0)\&. When executed, \fBsmbd\fR will automatically invoke the \fIadd share command\fR with four parameters\&. \fIconfigFile\fR - the location of the global \fIsmb\&.conf\fR file\&. \fIshareName\fR - the name of the new share\&. \fIpathName\fR - path to an **existing** directory on disk\&. \fIcomment\fR - comment string to associate with the new share\&. This parameter is only used for add file shares\&. To add printer shares, see the \fIaddprinter command\fR\&. 參見 \fIchange share command\fR, \fIdelete share command\fR\&. 預設設定: \fBnone\fR 示例: \fBadd share command = /usr/local/bin/addshare\fR .TP add user script (G) 這個選項指出一個指令碼的完整檔案路徑,這個指令碼將在特定環境下(下面有詳細解釋)由\fBsmbd\fR (8)\fB以root身份\fR執行. 通常,samba伺服器需要為所有訪問伺服器上檔案的使用者建立UNIX使用者賬號.但是在使用Windows NT賬號資料庫作為主使用者資料庫的站點,建立這些使用者並在與NT的主域控制器保持使用者列表同步是一件很麻煩的事情.這個選項使smbd可以在使用者訪問時\fB根據需要\fR自動生成UNIX使用者賬號. 為了使用這個選項,\fBsmbd\fR\fB必須\fR被設定成\fIsecurity=server\fR或者\fIsecurity=domain\fR,並且\fIadd user script\fR必須設為用\fI%u\fR引數來建立unix帳號的指令碼檔案的全路徑,\fI%u\fR擴充套件成建立的unix帳號名. 當windows使用者嘗試訪問samba伺服器時,在登陸時(建立SMB協議會話),\fBsmbd\fR與\fI口令伺服器\fR聯絡,並嘗試驗證使用者名稱和口令.如果成功,\fBsmbd\fR就會根據unix的口令檔案試著將這個windows使用者對映成一個unix使用者.如果查詢失敗,但設定了\fIadd user script \fR,smbd就會以\fBroot\fR的身份呼叫這個指令碼,將\fI%u\fR擴充套件成該要建立的使用者賬號. 如果這個指令碼執行成功,\fBsmbd\fR就認為這個使用者已經存在.用這種方式,可以動態建立UNIX使用者賬號並匹配已有的NT賬號. 參見 \fI security\fR, \fIpassword server\fR, \fIdelete user script\fR. 預設設定: \fBadd user script = <空字串>\fR 示例: \fBadd user script = /usr/local/samba/bin/add_user %u\fR .TP add user to group script (G) Full path to the script that will be called when a user is added to a group using the Windows NT domain administration tools\&. It will be run by \fBsmbd\fR(8) \fBAS ROOT\fR\&. Any \fI%g\fR will be replaced with the group name and any \fI%u\fR will be replaced with the user name\&. 預設設定: \fBadd user to group script = \fR 示例: \fBadd user to group script = /usr/sbin/adduser %u %g\fR .TP admin users (S) admin users定義一組對共享有管理特權的使用者.就相當於這些使用者可以象超級使用者那樣操作所有的檔案. 小心使用該選項,因為在這個名單裡的使用者可以對共享資源作任何他們想做的事. 預設設定: \fB沒有 admin users\fR 示例: \fBadmin users = jason\fR .TP afs share (S) This parameter controls whether special AFS features are enabled for this share\&. If enabled, it assumes that the directory exported via the \fIpath\fR parameter is a local AFS import\&. The special AFS features include the attempt to hand-craft an AFS token if you enabled --with-fake-kaserver in configure\&. 預設設定: \fBafs share = no\fR 示例: \fBafs share = yes\fR .TP afs username map (G) If you are using the fake kaserver AFS feature, you might want to hand-craft the usernames you are creating tokens for\&. For example this is necessary if you have users from several domain in your AFS Protection Database\&. One possible scheme to code users as DOMAIN+User as it is done by winbind with the + as a separator\&. The mapped user name must contain the cell name to log into, so without setting this parameter there will be no token\&. 預設設定: \fBnone\fR 示例: \fBafs username map = %u@afs.samba.org\fR .TP algorithmic rid base (G) This determines how Samba will use its algorithmic mapping from uids/gid to the RIDs needed to construct NT Security Identifiers\&. Setting this option to a larger value could be useful to sites transitioning from WinNT and Win2k, as existing user and group rids would otherwise clash with sytem users etc\&. All UIDs and GIDs must be able to be resolved into SIDs for the correct operation of ACLs on the server\&. As such the algorithmic mapping can't be 'turned off', but pushing it 'out of the way' should resolve the issues\&. Users and groups can then be assigned 'low' RIDs in arbitary-rid supporting backends\&. 預設設定: \fBalgorithmic rid base = 1000\fR 示例: \fBalgorithmic rid base = 100000\fR .TP allow hosts (S) 和\fIhosts allow\fR同義. .TP allow trusted domains (G) 這個選項只在\fIsecurity\fR選項被設成\fBserver\fR或\fBdomain\fR模式時才有效果.如果設為no的話,嘗試聯接到smbd執行的域或工作組以外的資源時會失敗,即使那個域是由遠端伺服器驗證為可信的也不行. 如果你只需要在域中對成員提供服務資源的話這個選項是非常有用的.舉例來說,假設有兩個域DOMA和DOMB,DOMA已經向DOMB進行了委託,而samba伺服器位於DOMA中.在通常情況下,在DOMB中有賬號的使用者可以用同樣的samba伺服器賬號名訪問UNIX上的資源.而無須他在DOMA上有賬號.不過這樣就使安全界線更難分清了. 預設設定: \fBallow trusted domains = yes\fR .TP announce as (G) 這個選項定義\fBnmbd\fR(8) 對網路鄰居聲稱的伺服器型別.預設為windows NT.可選項有"NT",它與"NT Server"同義,"NT Server","NT Workstation","Win95"或"WfW",它們分別代表Windows NT Server,Windows NT Workstation,Windows 95和Windows for Workgroups.除非有特殊的需要不想讓samba以windows NT的身份出現,一般不要改動這個選項,因為這可能會影響samba作為瀏覽伺服器的正確性. 預設設定: \fBannounce as = NT Server\fR 示例: \fBannounce as = Win95\fR .TP announce version (G) 此選項定義nmbd用於宣告伺服器版本號的主版本號和次版本號.預設版本號的是4.9。除非有特殊的必要想將samba設為低版本,一般不要改動這個選項. 預設設定: \fBannounce version = 4.9\fR 示例: \fBannounce version = 2.0\fR .TP auth methods (G) This option allows the administrator to chose what authentication methods \fBsmbd\fR will use when authenticating a user\&. This option defaults to sensible values based on \fIsecurity\fR\&. This should be considered a developer option and used only in rare circumstances\&. In the majority (if not all) of production servers, the default setting should be adequate\&. Each entry in the list attempts to authenticate the user in turn, until the user authenticates\&. In practice only one method will ever actually be able to complete the authentication\&. Possible options include \fBguest\fR (anonymous access), \fBsam\fR (lookups in local list of accounts based on netbios name or domain name), \fBwinbind\fR (relay authentication requests for remote users through winbindd), \fBntdomain\fR (pre-winbindd method of authentication for remote domain users; deprecated in favour of winbind method), \fBtrustdomain\fR (authenticate trusted users by contacting the remote DC directly from smbd; deprecated in favour of winbind method)\&. 預設設定: \fBauth methods = <空字串>\fR 示例: \fBauth methods = guest sam winbind\fR .TP auto services (G) 與 \fIpreload\fR 同義. .TP available (S) 這個選項可以用來關掉一個服務項.如果\fIavailable = no\fR,那麼\fB所有\fR對該服務的連線都會失敗.而這些失敗會被記錄下來. 預設設定: \fBavailable = yes\fR .TP bind interfaces only (G) 這個全域性選項允許samba管理員限制一臺主機的某一個網路介面用於響應請求.這會對於\fBsmbd\fR(8)檔案服務和\fBnmbd\fR(8)名字服務造成些許影響. 對於名字服務,它將使\fBnmbd\fR 繫結到'interfaces'選項裡列出的網路介面的137和138埠上.為了讀取廣播訊息,\fBnmbd\fR也會繫結到"所有地址"介面(0.0.0.0)的137和138埠上.如果沒有設定這個選項,\fBnmbd\fR將在所有的介面上響應名字服務請求.如果設定了"bind interfaces only",那麼\fBnmbd\fR將在廣播介面上檢查任何分組的源地址,丟棄任何不匹配\fIinterfaces\fR選項所列介面之廣播地址的分組.當在其它介面上收到單播分組,此選項使nmbd拒絕對任何不是是\fIinterfaces\fR選項所列介面來發送分組的主機的服務.IP源地址哄騙可以使這個簡單的檢查失效,所以不要將\fBnmbd\fR安全功能用於嚴肅場合. 對於檔案服務,該選項使\fBsmbd\fR(8)只在'interfaces'選項所列的網路介面上繫結.這就限制\fBsmbd\fR 只響應那些介面上發出的分組.注意,不應該在PPP和時斷時續的機器上或非廣播網路介面上使用這個選項,因為它處理不了非永久連線的介面. 如果設定了\fIbind interfaces only\fR,除非網路地址\fB127.0.0.1\fR被加到\fIinterfaces\fR選項的列表中,否則\fBsmbpasswd\fR(8)和\fBswat\fR(8) 可能不會象我們所期望的那樣工作,原因如下: 為了改變使用者SMB口令,\fBsmbpasswd\fR預設情況下會以smb客戶端的身份連線本地主機地址\fBlocalhost - 127.0.0.1\fR,發出更改口令請求.如果設定了\fIbind interfaces only\fR,\fBsmbpasswd\fR在預設情況下將會連線失敗,除非\fB127.0.0.1\fR已被加入到\fIinterfaces\fR選項.另外,可以用\fI-r remote machine\fR選項指定本地主機的主網路介面ip地址,這樣\fBsmbpasswd\fR就會強制使用本地的主ip地址. \fBswat\fR的狀態頁面會在\fB127.0.0.1\fR嘗試連線\fBsmbd\fR和 \fBnmbd\fR,以確定它們是否正在執行.如果不加入\fB127.0.0.1\fR,將會使\fBsmbd\fR和\fBnmbd\fR 總表示沒有執行甚至實際情況並不是這樣.這就阻止了\fB swat\fR啟動/停止/重啟動\fBsmbd\fR 和\fBnmbd\fR程序. 預設設定: \fBbind interfaces only = no\fR .TP blocking locks (S) 此項控制在客戶為了在開啟檔案處獲得一個位元組範圍的鎖定而發出請求時\fBsmbd\fR(8)的動作,同時 該請求會有一個與之相關的時限. 如果設定了這個選項,鎖定範圍請求不能立即滿足的話,samba將會在內部對請求進行排隊,並且週期性地嘗試獲得鎖定,直到超時. 如果這個選項設定為\fBno\fR,samba就會同以前版本那樣,在鎖定範圍無法獲得時立即使鎖定請求失敗. 預設設定: \fBblocking locks = yes\fR .TP block size (S) This parameter controls the behavior of \fBsmbd\fR(8) when reporting disk free sizes\&. By default, this reports a disk block size of 1024 bytes\&. Changing this parameter may have some effect on the efficiency of client writes, this is not yet confirmed\&. This parameter was added to allow advanced administrators to change it (usually to a higher value) and test the effect it has on client write performance without re-compiling the code\&. As this is an experimental option it may be removed in a future release\&. Changing this option does not change the disk free reporting size, just the block size unit reported to the client\&. .TP browsable (S) 與 \fIbrowseable\fR 同義。 .TP browseable (S) 這個選項控制共享資源在可獲得共享列表、net view命令及瀏覽列表裡是否可見. 預設設定: \fBbrowseable = yes\fR .TP browse list (G) 它控制\fBsmbd\fR(8)是否執行一個\fBNetServerEnum\fR呼叫來為客戶提供一個瀏覽列表.正常情況它被設為\fByes\fR.這個選項可能永遠不需要改動. 預設設定: \fBbrowse list = yes\fR .TP case sensitive (S) 參見NAME MANGLING段的討論. 預設設定: \fBcase sensitive = no\fR .TP casesignames (S) 與 \fIcase sensitive\fR 同義. .TP change notify timeout (G) samba允許客戶端告訴伺服器監視某個特定目錄的任何變化,僅當有變化發生的時候回覆SMB請求.這種連續不斷的掃描在unix系統上代價很高,因此,\fBsmbd\fR(8)只在等待\fIchange notify timeout\fR時間後才對每個請求的目錄執行一次掃描. 預設設定: \fBchange notify timeout = 60\fR 示例: \fBchange notify timeout = 300\fR 這將把掃描時間改為每5分鐘一次. .TP change share command (G) Samba 2\&.2\&.0 introduced the ability to dynamically add and delete shares via the Windows NT 4\&.0 Server Manager\&. The \fIchange share command\fR is used to define an external program or script which will modify an existing service definition in \fIsmb\&.conf\fR\&. In order to successfully execute the \fIchange share command\fR, \fBsmbd\fR requires that the administrator be connected using a root account (i\&.e\&. uid == 0)\&. When executed, \fBsmbd\fR will automatically invoke the \fIchange share command\fR with four parameters\&. \fIconfigFile\fR - the location of the global \fIsmb\&.conf\fR file\&. \fIshareName\fR - the name of the new share\&. \fIpathName\fR - path to an **existing** directory on disk\&. \fIcomment\fR - comment string to associate with the new share\&. This parameter is only used modify existing file shares definitions\&. To modify printer shares, use the "Printers\&.\&.\&." folder as seen when browsing the Samba host\&. 參見 \fIadd share command\fR, \fIdelete share command\fR\&. 預設設定: \fBnone\fR 示例: \fBchange share command = /usr/local/bin/addshare\fR .TP client lanman auth (G) This parameter determines whether or not \fBsmbclient\fR(8) and other samba client tools will attempt to authenticate itself to servers using the weaker LANMAN password hash\&. If disabled, only server which support NT password hashes (e\&.g\&. Windows NT/2000, Samba, etc\&.\&.\&. but not Windows 95/98) will be able to be connected from the Samba client\&. The LANMAN encrypted response is easily broken, due to it's case-insensitive nature, and the choice of algorithm\&. Clients without Windows 95/98 servers are advised to disable this option\&. Disabling this option will also disable the \fBclient plaintext auth\fR option Likewise, if the \fBclient ntlmv2 auth\fR parameter is enabled, then only NTLMv2 logins will be attempted\&. Not all servers support NTLMv2, and most will require special configuration to us it\&. Default : \fBclient lanman auth = yes\fR .TP client ntlmv2 auth (G) This parameter determines whether or not \fBsmbclient\fR(8) will attempt to authenticate itself to servers using the NTLMv2 encrypted password response\&. If enabled, only an NTLMv2 and LMv2 response (both much more secure than earlier versions) will be sent\&. Many servers (including NT4 < SP4, Win9x and Samba 2\&.2) are not compatible with NTLMv2\&. Similarly, if enabled, NTLMv1, \fBclient lanman auth\fR and \fBclient plaintext auth\fR authentication will be disabled\&. This also disables share-level authentication\&. If disabled, an NTLM response (and possibly a LANMAN response) will be sent by the client, depending on the value of \fBclient lanman auth\fR\&. Note that some sites (particularly those following 'best practice' security polices) only allow NTLMv2 responses, and not the weaker LM or NTLM\&. Default : \fBclient ntlmv2 auth = no\fR .TP client plaintext auth (G) Specifies whether a client should send a plaintext password if the server does not support encrypted passwords\&. 預設設定: \fBclient plaintext auth = yes\fR .TP client schannel (G) This controls whether the client offers or even demands the use of the netlogon schannel\&. \fIclient schannel = no\fR does not offer the schannel, \fIserver schannel = auto\fR offers the schannel but does not enforce it, and \fIserver schannel = yes\fR denies access if the server is not able to speak netlogon schannel\&. 預設設定: \fBclient schannel = auto\fR 示例: \fBclient schannel = yes\fR .TP client signing (G) This controls whether the client offers or requires the server it talks to to use SMB signing\&. Possible values are \fBauto\fR, \fBmandatory\fR and \fBdisabled\fR\&. When set to auto, SMB signing is offered, but not enforced\&. When set to mandatory, SMB signing is required and if set to disabled, SMB signing is not offered either\&. 預設設定: \fBclient signing = auto\fR .TP client use spnego (G) This variable controls controls whether samba clients will try to use Simple and Protected NEGOciation (as specified by rfc2478) with WindowsXP and Windows2000 servers to agree upon an authentication mechanism\&. SPNEGO client support for SMB Signing is currently broken, so you might want to turn this option off when operating with Windows 2003 domain controllers in particular\&. 預設設定: \fBclient use spnego = yes\fR .TP comment (S) 這是一段當客戶用\fB網路上的芳鄰\fR(\fBnet view\fR)察看伺服器上共享資源時顯示的說明文字. 如果想設定機器名後的說明文字請參考 \fI server string\fR 命令. 預設設定: \fBNo comment string\fR 示例: \fBcomment = Fred's Files\fR .TP config file (G) 這可以使samba使用指定的配置檔案來替代預設的配置檔案,(通常是\fIsmb\&.conf\fR).如果設定了這個選項,會出現一個先有雞還是先有蛋的問題! 由於這個原因,如果在載入這個選項的時候發現配置檔名變化了,就會從新的配置檔案裡重新載入選項. 這個選項作為常用的替換非常有用. 如果這個配置檔案不存在,那麼就不會被載入.(允許你特殊地處理少數客戶的配置檔案) 示例: \fBconfig file = /usr/local/samba/lib/smb.conf.%m\fR .TP copy (S) 這使你可以克隆服務. 指定的服務以當前服務的名字進行簡單的複製,當前服務裡定義的選項將替代被拷服務裡任何相應的選項. 這個特性允許建立一個服務的'模版',可以很容易的生成相似的服務.注意,被複製的服務在配置檔案裡必須先於複製的服務出現. 預設設定: \fBno value\fR 示例: \fBcopy = otherservice\fR .TP create mask (S) 與 \fIcreate mode\fR 同義. 當生成一個檔案的時候,需要知道從dos模式對映到unix下的檔案許可權.最後的結果用這個引數進行逐位的與運算得到.這個選項可以理解成unix下檔案的位掩碼.在生成檔案的時候,任何\fB沒有\fR設定的位將會從建立模式中去掉. 這個選項的預設值是從unix的檔案建立模式中去掉組和其他使用者的寫和執行標誌位. 根據這個規則,samba將會把這個選項生成的unix檔案建立模式和由\fIforce create mode\fR設定的選項進行逐位的或運算,\fIforce create mode\fR 的預設選項是000. 這個選項不會影響目錄建立模式.細節參見\fIdirectory mode \fR . 參考\fIforce create mode\fR以進一步瞭解在建立檔案時設定的特殊位.關於建立目錄模式參見\fIdirectory mode\fR選項.參見 \fIinherit permissions\fR parameter. Note that this parameter does not apply to permissions set by Windows NT/2000 ACL editors\&. If the administrator wishes to enforce a mask on access control lists also, they need to set the \fIsecurity mask\fR\&. 預設設定: \fBcreate mask = 0744\fR 示例: \fBcreate mask = 0775\fR .TP create mode (S) 與 \fI create mask\fR 同義. .TP csc policy (S) This stands for \fBclient-side caching policy\fR, and specifies how clients capable of offline caching will cache the files in the share\&. The valid values are: manual, documents, programs, disable\&. These values correspond to those used on Windows servers\&. For example, shares containing roaming profiles can have offline caching disabled using \fBcsc policy = disable\fR\&. 預設設定: \fBcsc policy = manual\fR 示例: \fBcsc policy = programs\fR .TP deadtime (G) 這個值(十進位制整數)定義連線發呆超時,單位是分鐘.如果一個連線發超過了這個時間就會被斷開.如果有檔案被打開了,這個時間就不起作用. 這可以保護伺服器不被過多的發呆連線耗盡資源. 多數客戶端有連線斷開後的自動重連功能,所以大多數情況下,這個選項對使用者應該是透明的 對多數系統建議使用較短的發呆超時的選項. 發呆超時選項被設為0意味著不會自動斷開連線.. 預設設定: \fBdeadtime = 0\fR 示例: \fBdeadtime = 15\fR .TP debug hires timestamp (G) 有些時候記錄資訊需要比秒更高層次的時間標識,用這個布林量選項可以向時間標識資訊頭中加入以微秒級的頻率. 注意要使用這個選項,必須開啟\fI debug timestamp\fR選項. 預設設定: \fBdebug hires timestamp = no\fR .TP debuglevel (G) 與 \fI log level\fR 同義. .TP debug pid (G) 為很多從\fBsmbd\fR(8)fork出來的程序使用同一個記錄檔案時,很難精確地跟蹤資訊是哪個程序輸出的.用這個布林量選項向時間標識資訊頭中自動新增程序號. 注意要使用這個選項,必須開啟\fI debug timestamp\fR 選項. 預設設定: \fBdebug pid = no\fR .TP debug timestamp (G) samba預設會給除錯紀錄資訊加上時間標識.如果執行的是高級別\fIdebug level\fR的除錯,這個時間標識可以被轉移.用這個選項可以將時間標識關閉. 預設設定: \fBdebug timestamp = yes\fR .TP debug uid (G) samba有時以root身份執行,而有時以已聯接的使用者來執行.使用這個布林量選項可以向記錄檔案的時間標識資訊頭中自動插入當前的euid,egid,uid和gid標識. Note that the parameter must be on for this to have an effect\&. 注意要使用這個選項,必須開啟\fI debug timestamp\fR選項. 預設設定: \fBdebug uid = no\fR .TP default (G) 與 \fI default service\fR 同義. .TP default case (S) 參見"NAME MANGLING"段. 也注意一下\fIshort preserve case\fR選項. 預設設定: \fBdefault case = lower\fR .TP default devmode (S) This parameter is only applicable to printable services\&. When smbd is serving Printer Drivers to Windows NT/2k/XP clients, each printer on the Samba server has a Device Mode which defines things such as paper size and orientation and duplex settings\&. The device mode can only correctly be generated by the printer driver itself (which can only be executed on a Win32 platform)\&. Because smbd is unable to execute the driver code to generate the device mode, the default behavior is to set this field to NULL\&. Most problems with serving printer drivers to Windows NT/2k/XP clients can be traced to a problem with the generated device mode\&. Certain drivers will do things such as crashing the client's Explorer\&.exe with a NULL devmode\&. However, other printer drivers can cause the client's spooler service (spoolsv\&.exe) to die if the devmode was not created by the driver itself (i\&.e\&. smbd generates a default devmode)\&. This parameter should be used with care and tested with the printer driver in question\&. It is better to leave the device mode to NULL and let the Windows client set the correct values\&. Because drivers do not do this all the time, setting \fBdefault devmode = yes\fR will instruct smbd to generate a default one\&. For more information on Windows NT/2k printing and Device Modes, see the MSDN documentation\&. 預設設定: \fBdefault devmode = no\fR .TP default service (G) 這個選項定義一個當指定服務找不到時的預設服務.注意,在選項值裡\fB沒有\fR方括號(看示例!). 這個選項沒有預設值. 如果沒給出這個選項的話,對不存在的服務的請求將返回錯誤. 預設服務一般是那些允許\fIguest ok\fR, \fIread-only\fR的服務. 外在的服務名可能被替換成請求的服務名,這樣就可以用象\fI%S\fR這樣的宏來做一個通用的服務. 注意在預設服務選項指定的服務名裡, 字元'_'被對映為'/'. 這樣可能會出現有趣的事情. 示例: .nf [global] default service = pub [pub] path = /%S .fi .TP delete group script (G) This is the full pathname to a script that will be run \fBAS ROOT\fR \fBsmbd\fR(8) when a group is requested to be deleted\&. It will expand any \fI%g\fR to the group name passed\&. This script is only useful for installations using the Windows NT domain administration tools\&. .TP deleteprinter command (G) With the introduction of MS-RPC based printer support for Windows NT/2000 clients in Samba 2\&.2, it is now possible to delete printer at run time by issuing the DeletePrinter() RPC call\&. For a Samba host this means that the printer must be physically deleted from underlying printing system\&. The \fI deleteprinter command\fR defines a script to be run which will perform the necessary operations for removing the printer from the print system and from \fIsmb\&.conf\fR\&. The \fIdeleteprinter command\fR is automatically called with only one parameter: \fI "printer name"\fR\&. Once the \fIdeleteprinter command\fR has been executed, \fBsmbd\fR will reparse the \fI smb\&.conf\fR to associated printer no longer exists\&. If the sharename is still valid, then \fBsmbd \fR will return an ACCESS_DENIED error to the client\&. 參見 \fI addprinter command\fR, \fIprinting\fR, \fIshow add printer wizard\fR 預設設定: \fBnone\fR 示例: \fBdeleteprinter command = /usr/bin/removeprinter\fR .TP delete readonly (S) 這個選項允許刪除只讀檔案,這個只讀不是通常dos裡的含義,而是unix中的. 這個選項對於rcs這樣的應用很有用,在這種情況下,unix檔案的屬主不允許改變許可權,dos檔案只讀. 預設設定: \fBdelete readonly = no\fR .TP delete share command (G) Samba 2\&.2\&.0 introduced the ability to dynamically add and delete shares via the Windows NT 4\&.0 Server Manager\&. The \fIdelete share command\fR is used to define an external program or script which will remove an existing service definition from \fIsmb\&.conf\fR\&. In order to successfully execute the \fIdelete share command\fR, \fBsmbd\fR requires that the administrator be connected using a root account (i\&.e\&. uid == 0)\&. When executed, \fBsmbd\fR will automatically invoke the \fIdelete share command\fR with two parameters\&. \fIconfigFile\fR - the location of the global \fIsmb\&.conf\fR file\&. \fIshareName\fR - the name of the existing service\&. This parameter is only used to remove file shares\&. To delete printer shares, see the \fIdeleteprinter command\fR\&. 參見 \fIadd share command\fR, \fIchange share command\fR\&. 預設設定: \fBnone\fR 示例: \fBdelete share command = /usr/local/bin/delshare\fR .TP delete user from group script (G) Full path to the script that will be called when a user is removed from a group using the Windows NT domain administration tools\&. It will be run by \fBsmbd\fR(8) \fBAS ROOT\fR\&. Any \fI%g\fR will be replaced with the group name and any \fI%u\fR will be replaced with the user name\&. 預設設定: \fBdelete user from group script = \fR 示例: \fBdelete user from group script = /usr/sbin/deluser %u %g\fR .TP delete user script (G) 它定義一個在使用RPC(NT)工具管理使用者時,fBsmbd\fR(8)以root身份執行的包括路徑的一個指令碼. 當遠端客戶使用'User Manager for Domains' 或是 \fBrpcclient\fR 從伺服器上刪除一個使用者時執行此操作。 這個指令碼刪除給定的unix使用者。 預設設定: \fBdelete user script = <空字串>\fR 示例: \fBdelete user script = /usr/local/samba/bin/del_user %u\fR .TP delete veto files (S) 這個選項用於samba試圖刪除一個或多個包含禁止檔案的目錄的情況(參見\fIveto files\fR選項). 如果這個選項設定為\fBno\fR(預設情況),那麼如果一個禁止目錄裡包含了任何非禁止的檔案或目錄,刪除就會失敗.這通常正是你所希望的. 如果這個選項被設為了 \fByes\fR,Samba將試圖遞迴刪除在被禁止目錄裡的任何檔案和目錄.這對於整合象NetAtalk這樣的檔案服務系統很有用,它通常會在目錄裡生成Dos/windows使用者看不見的中間檔案(e.g. \fI.AppleDouble\fR). 設定\fBdelete veto files = yes\fR 使那些有許可權的使用者可以在刪除父目錄的時候透明的刪除子目錄. 參見 \fIveto files\fR 選項. 預設設定: \fBdelete veto files = no\fR .TP deny hosts (S) 與 \fIhosts deny\fR 同義. .TP dfree command (G) \fIdfree command\fR只需在磁碟空間計算有問題的系統上使用.這個空間計算的問題僅在Ultrix系統上發生過,但在其他的作業系統上也有可能發生.發生這個問題的現象是在每個目錄列表最後發生錯誤並提示"Abort Retry Ignore". 這個設定允許用外部程式代替內部程式來計算總共的磁碟空間和可用的磁碟空間.下面的例子給出了一個能完成這個功能的指令碼. 這個外部程式的輸入是檔案系統裡一個需要計算的目錄,典型的包括\fI./\fR字串.以ascii碼返回兩個整數.第一個是總共的磁碟空間(以塊為單位),第二個是可用塊樹.可選的第三個返回值可以以位元組為單位給出塊的大小.預設的塊的大小是1024位元組. 注意:這個指令碼應該屬主為root,\fB只有\fRroot可寫,並且\fB不能\fR帶有使用者標識位和組標識位(setuid or setgid)! 預設設定: \fB預設用內部程式來計算磁碟容量和可用空間. \fR 示例: \fBdfree command = /usr/local/samba/bin/dfree\fR 如下這個dfree指令碼必須是可執行的. .nf #!/bin/sh df $1 | tail -1 | awk '{print $2" "$4}' .fi 在Sys V一類的系統上可能是: .nf #!/bin/sh /usr/bin/df -k $1 | tail -1 | awk '{print $3" "$5}' .fi 注意在特定的系統上可能需要給出相應的帶有全路徑的命令. .TP directory (S) 與 \fIpath\fR 同義. .TP directory mask (S) 這個選項是8進位制的模式。用來控制在生成UNIX目錄時,將其從dos模式轉換為unix模式。 當生成一個路徑的時候,必須指定的目錄許可權從dos模式對映到unix模式,然後這個結果和這個選項進行逐位的與運算.這個選項可以理解成unix模式下的位掩碼.這個選項裡任何\fB沒有\fR設定的位在生成unix下的目錄時將會被去掉 預設情況下,這個選項把組和其他使用者的寫許可權位去掉,只允許目錄的屬主對目錄進行修改. Samba將把這個選項和\fIforce directory mode\fR的選項進行逐位的或運算,這個選項預設時設定為000(也就是不加額外的限制). Note that this parameter does not apply to permissions set by Windows NT/2000 ACL editors. If the administrator wishes to enforce a mask on access control lists also, they need to set the \fIdirectory security mask\fR. 在生成目錄時如果需要設定特殊的模式位,參見\fIforce directory mode\fR選項. 關於生成檔案時的模式位參見\fIcreate mode \fR選項和\fIdirectory security mask\fR選項. Also refer to the \fI inherit permissions\fR parameter. 預設設定: \fBdirectory mask = 0755\fR 示例: \fBdirectory mask = 0775\fR .TP directory mode (S) 與 \fI directory mask\fR 同義。 .TP directory security mask (S) 此選項控制了NT客戶在他的本地NT安全對話方塊中操縱unix目錄許可權時可以修改哪些許可權位. 這個選項以掩碼來實現改變許可權位,所以在修改時要防止不在掩碼中涉及的那些位.實際上,在這個掩碼中的位0可以使使用者無法改變任何東東. 如果沒有明確設定的話,這個選項會用與directory mask選項同樣的值.要允許使用者在目錄中可以修改所有的user/group/world許可權,可以把這個選項設為0777. \fB注意\fR,能訪問samba伺服器的使用者透過其它方法也可以很容易地繞過這個限制,所以對獨立工作的系統來說這個選項是最根本最有用的.很多系統管理的管理員都會把它設為預設的\fB0777\fR. 參見\fI force directory security mode\fR, \fIsecurity mask\fR, \fIforce security mode \fR 選項。 預設設定: \fBdirectory security mask = 0777\fR 示例: \fBdirectory security mask = 0700\fR .TP disable netbios (G) Enabling this parameter will disable netbios support in Samba\&. Netbios is the only available form of browsing in all windows versions except for 2000 and XP\&. Note that clients that only support netbios won't be able to see your samba server when netbios support is disabled\&. 預設設定: \fBdisable netbios = no\fR 示例: \fBdisable netbios = yes\fR .TP disable spoolss (G) Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's and will yield identical behavior as Samba 2\&.0\&.x\&. Windows NT/2000 clients will downgrade to using Lanman style printing commands\&. Windows 9x/ME will be uneffected by the 選項。 However, this will also disable the ability to upload printer drivers to a Samba server via the Windows NT Add Printer Wizard or by using the NT printer properties dialog window\&. It will also disable the capability of Windows NT/2000 clients to download print drivers from the Samba host upon demand\&. \fBBe very careful about enabling this 選項。\fR See also use client driver Default : \fBdisable spoolss = no\fR .TP display charset (G) Specifies the charset that samba will use to print messages to stdout and stderr and SWAT will use\&. Should generally be the same as the \fBunix charset\fR\&. 預設設定: \fBdisplay charset = ASCII\fR 示例: \fBdisplay charset = UTF8\fR .TP dns proxy (G) 指定\fBnmbd\fR(8)象WINS伺服器那樣尋找沒有登記的NetBIOS名,象對待DNS名那樣逐字的對待NetBIOS名,向DNS伺服器查詢該名稱所代表的客戶端. 注意,NetBISO名的最大長度是15個字元,所以DNS名(或DNS別名)同樣最多隻能有15個字元. \fBnmbd\fR 在做DNS名查詢的時候將自身複製一份,因為域名查詢是一個阻塞的動作. 參見 \fI wins support\fR 。 預設設定: \fBdns proxy = yes\fR .TP domain logons (G) 如果這個選項為\fByes\fR,Samba伺服器將為\fIworkgroup\fR提供Windows 95/98 登陸域服務.Samba 2.2只能實現Windows NT 4 域中域控制器的有限功能。有關設定這個功能的更詳細資訊參見Samba 文件中的Samba-PDC-HOWTO。 預設設定: \fBdomain logons = no\fR .TP domain master (G) 這個選項告訴\fBsmbd\fR(8)收集廣域網內的瀏覽列表.設定這個選項後,\fBnmbd\fR用一個特定的NetBIOS名向它的\fI工作組\fR標識它自己是一個主控瀏覽器.在同一\fI工作組\fR不同子網中的本地主控瀏覽器將把自己的瀏覽列表傳給\fBnmbd\fR,然後向\fBsmbd\fR(8) 請求整個網路上瀏覽列表的完整複製.客戶端將和他們的本地主控瀏覽器聯絡,得到整個域範圍內的瀏覽列表,而不只是子網上的列表. 注意,windows NT主域控制器預設情況總是佔有這個在\fI工作組\fR中的特殊的NetBIOS名,宣稱自己是\fI工作組\fR的主域瀏覽器(也就是說,沒有什麼方法可以阻止一個Windows NT主域控制器這樣做). 這樣如果設定了這個選項,並且\fBnmbd\fR 在Windows NT之前向\fI工作組\fR宣稱了這個特殊的名字,那麼跨子網的瀏覽行為會變得奇怪,並且可能會失敗. If \fBdomain logons = yes\fR , then the default behavior is to enable the \fIdomain master\fR 選項。 If \fIdomain logons\fR is not enabled (the default setting), then neither will \fIdomain master\fR be enabled by default\&. 預設設定: \fBdomain master = auto\fR .\" -=>從此以上為ttao翻譯 .\" -=>從此以下為Edwin Chen翻譯 .TP dont descend (S) 有些系統上存在某些特殊的路徑(比如linux中的\fI/proc\fR),這些目錄不需要(也不希望)客戶端關心,甚至可能具有無限的層次深度(遞迴的).這個選項允許你指定一個由逗號分隔的列表,伺服器將把列表內包含的目錄始終顯示成空目錄. 注意,Samba對'dont descend'選項的輸入格式十分挑剔.例如他也許要求你輸入\fI./proc\fR而不是僅僅是\fI/proc\fR.實踐是最好的策略. 預設設定: \fBnone (也就是說,所有目錄的內容會正常的傳遞給客戶端)\fR 示例: \fBdont descend = /proc,/dev\fR .TP dos charset (G) DOS SMB clients assume the server has the same charset as they do\&. This option specifies which charset Samba should talk to DOS clients\&. The default depends on which charsets you have installed\&. Samba tries to use charset 850 but falls back to ASCII in case it is not available\&. Run \fBtestparm\fR(1) to check the default on your system\&. .TP dos filemode (S) The default behavior in Samba is to provide UNIX-like behavior where only the owner of a file/directory is able to change the permissions on it\&. However, this behavior is often confusing to DOS/Windows users\&. Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions on it\&. Note that a user belonging to the group owning the file will not be allowed to change permissions if the group is only granted read access\&. Ownership of the file/directory is not changed, only the permissions are modified\&. 預設設定: \fBdos filemode = no\fR .TP dos filetime resolution (S) 在DOS和Windows FAT檔案系統中,時間的計量精度是2秒。對共享資源設定這個選項,可以使得在一個向\fBsmbd\fR(8)的查詢需要1秒精度時,Samba把報告的時間精度降低到2秒左右。 這個選項的主要用於解決Visual C++與Samba的相容性問題.當共享檔案被鎖定時(oplocks選項被設定為允許),Visual C++使用兩個不同的讀取時間的函式呼叫來檢查檔案自從最後一次讀操作以來是否有改變.其中一個函式使用1秒的時間尺度,而另一個則使用2秒的時間尺度.由於使用基於2秒的方法要捨去任何的奇數秒,當檔案的時間記錄是奇數秒時,Visual C++的兩次函式呼叫結果就會不一致,Visual C++就會總是認為檔案被改變.設定這個選項可以使得兩次函式呼叫的結果一致,Visual C++會很高興的接受這一切. 預設設定: \fBdos filetime resolution = no\fR .TP dos filetimes (S) 在DOS和Windows作業系統中,如果使用者對檔案進行寫操作,就會改變檔案的時間記錄.而在POSIX規則中,只有檔案的所有者和root才有改變檔案時間記錄的能力.預設的,Samba按照POSIX規則執行,如果\fBsmbd\fR的使用者不是檔案的所有者,那麼他對檔案的操作不會改變檔案的時間記錄.如果設定這個選項為\fB yes\fR,那麼\fBsmbd\fR(8)就按照DOS的規則執行,並且按照DOS系統的要求改變檔案的時間記錄. 預設設定: \fBdos filetimes = no\fR .TP enable rid algorithm (G) This option is used to control whether or not smbd in Samba 3\&.0 should fallback to the algorithm used by Samba 2\&.2 to generate user and group RIDs\&. The longterm development goal is to remove the algorithmic mappings of RIDs altogether, but this has proved to be difficult\&. This parameter is mainly provided so that developers can turn the algorithm on and off and see what breaks\&. This parameter should not be disabled by non-developers because certain features in Samba will fail to work without it\&. 預設設定: \fBenable rid algorithm = \fR .TP encrypt passwords (G) 這個布林型值控制著是否與客戶端用加密口令進行交談.注意,NT4.0 SP3 及以上還有WINDOWS 98在預設情況下使用加密口令進行交談,除非改變了登錄檔的相應健值.想要使用加密口令,清參閱Samba HOWTO Collection中的 "User Database" 章節。 想要使加密口令能正確的工作, \fBsmbd\fR(8)必須能訪問本地的\fBsmbpasswd\fR(5)檔案(如何正確設定和維護這個檔案,請參閱\fBsmbpasswd\fR(8)手冊),或者,設定選項security= [server|domain|ads],這樣設定將使得\fBsmbd\fR依賴其它的伺服器來幫它鑑別口令. 預設設定: \fBencrypt passwords = yes\fR .TP enhanced browsing (G) This option enables a couple of enhancements to cross-subnet browse propagation that have been added in Samba but which are not standard in Microsoft implementations\&. The first enhancement to browse propagation consists of a regular wildcard query to a Samba WINS server for all Domain Master Browsers, followed by a browse synchronization with each of the returned DMBs\&. The second enhancement consists of a regular randomised browse synchronization with all currently known DMBs\&. You may wish to disable this option if you have a problem with empty workgroups not disappearing from browse lists\&. Due to the restrictions of the browse protocols these enhancements can cause a empty workgroup to stay around forever which can be annoying\&. In general you should leave this option enabled as it makes cross-subnet browse propagation much more reliable\&. 預設設定: \fBenhanced browsing = yes\fR .TP enumports command (G) The concept of a "port" is fairly foreign to UNIX hosts\&. Under Windows NT/2000 print servers, a port is associated with a port monitor and generally takes the form of a local port (i\&.e\&. LPT1:, COM1:, FILE:) or a remote port (i\&.e\&. LPD Port Monitor, etc\&.\&.\&.)\&. By default, Samba has only one port defined--\fB"Samba Printer Port"\fR\&. Under Windows NT/2000, all printers must have a valid port name\&. If you wish to have a list of ports displayed (\fBsmbd \fR does not use a port name for anything) other than the default \fB"Samba Printer Port"\fR, you can define \fIenumports command\fR to point to a program which should generate a list of ports, one per line, to standard output\&. This listing will then be used in response to the level 1 and 2 EnumPorts() RPC\&. 預設設定: \fBno enumports command\fR 示例: \fBenumports command = /usr/bin/listports\fR .TP exec (S) 與 \fIpreexec\fR 同義。 .TP fake directory create times (S) NTFS和Windows VFAT檔案系統為每一個檔案和目錄保留一個建立時間. 這個時間和UNIX下的狀態改變時間--ctime不同. 所以, 在預設狀態下, Samba將報告UNIX系統所保持的各種時間屬性中的最早的那個作為(檔案/目錄)建立時間. 如果在一個共享中設定了這個選項, 將會使得Samba偽造一個目錄生成時間, 這個時間就是1980.01.01的午夜. 這個選項的主要用於解決Visual C++與Samba的相容性問題.Visual C++生成makefiles檔案時, 包含目標檔案所依賴的目的目錄. 包含建立目錄的規則. 同樣的, 當NMAKE比較時間屬性時, 它檢查目錄建立時間. 目標目錄不存在的話, 會建立一個;如果存在,它的建立時間總是比它所包含的目標檔案的建立時間早. UNIX的時間規則意味著只要有檔案在共享目錄中建立或刪除,Samba將更新關於該目錄建立時間的報告. NMAKE將發現目錄中除了最後建立的檔案以外的所有目標檔案都過期了(與目錄的建立時間相比較), 然後重新編譯目標檔案.設定這個選項值將保證目錄的建立時間早於它裡面的檔案,NMAKE就能夠正常工作. 預設設定: \fBfake directory create times = no\fR .TP fake oplocks (S) oplocks是這樣一個選項, 它允許SMB客戶端在本地快取對伺服器的檔案操作. 如果伺服器允許oplock(opportunistic lock)操作, 客戶端可以簡單的認為, 它自己是唯一的檔案訪問者, 可以隨意的快取檔案. 有些oplocks型別甚至允許快取檔案的開啟和關閉操作. 這個操作換來效能上的巨大提升. 當你設定\fBfake oplocks = yes\fR後,\fBsmbd\fR(8)總是允許oplock請求, 而不管到底有多少的客戶端在使用這個檔案. 在通常情況下, 使用真實的\fIoplocks\fR支援總是比使用這個選項好. 如果你使用這個選項在一些只讀的共享上(例如: CDROM共享),或者你知道這個共享只能夠被一個客戶端所訪問(例如: 客戶主目錄). 你將會注意到效能上的重大提升. 如果你將這個選項用在多個客戶端都可以讀寫的共享上, 由於客戶可能同時訪問一個共享檔案, 這樣會造成檔案損壞. 請一定小心使用. 預設設定: \fBfake oplocks = no\fR .TP follow symlinks (S) 這個選項允許Samba管理員禁止某個特殊共享下\fBsmbd\fR(8)對符號連結的訪問. 將這個選項設定為\fBno\fR將會阻止這個共享下的任何連結形式的檔案或目錄被檢視(使用者將會得到一個錯誤資訊).例如: 這個選項將阻止客戶將\fI/etc/passwd\fR檔案連結到自己的主目錄. (我們看到, 這是很有用的). 但是, 它將會使檔名字的查詢速度慢一些. 這個選項預設是允許(也就是, \fBsmbd\fR將允許訪問符號連結) 預設設定: \fBfollow symlinks = yes\fR .TP force create mode (S) 這個選項設定一組UNIX格式的許可權程式碼, 當Samba建立新文件的時候, \fB總是\fR會使用這個許可權設定新文件, 透過將新文件的許可權位和這組許可權程式碼做逐位與, 就完成了設定工作.預設狀態下, 這個選項設定為八進位制000,在\fIcreate mask\fR加到新建立的檔案的許可權位上後, 與這個值進行按位與操作, 就得到檔案建立時的許可權設定. 參見 \fIcreate mask\fR 來獲得關於建立檔案時的掩碼的詳細資料。 另外也參見 \fIinherit permissions\fR 引數. 預設設定: \fBforce create mode = 000\fR 示例: \fBforce create mode = 0755\fR 這個例子中, 將迫使所有被建立的文件對"同組/其它(使用者)"有讀和執行權. 對使用者自己有讀/寫/執行權力. .TP force directory mode (S) 這個選項設定一組UNIX格式的許可權程式碼, 當Samba建立新目錄的時候, \fB總是\fR會使用這個許可權設定新目錄, 透過將新目錄的許可權位和這組許可權程式碼做逐位與, 就完成了設定工作.預設狀態下, 這個選項設定為八進位制000,在\fIdirectory mask\fR加到新建立的目錄的許可權位上後,與這個值進行按位與操作, 就得到目錄建立時的許可權設定. 參見\fI directory mask\fR 來獲得關於建立目錄時的掩碼的詳細資料。 另外也參見\fI inherit permissions\fR引數. 預設設定: \fBforce directory mode = 000\fR 示例: \fBforce directory mode = 0755\fR 這個例子中, 將迫使所有被建立的目錄對"同組/其它(使用者)"有讀和進入權. 對使用者自己有讀/寫/進入權力. .TP force directory security mode (S) 此選項控制NT使用者透過本地NT安全對話方塊可以操作哪些目錄上的unix許可權位. 此選項以掩碼('or')來實現許可權位的改變,所以它強制了任何掩碼中使用者可以更改的位.實際上,當在修改目錄的安全性時,這個掩碼中的一個0位可以作為一組使用者已經設為'on'的位來看待. 如果沒有明確設定的話,這個選項會用與force directory mode選項同樣的值.要允許使用者在目錄中可以修改所有的user/group/world許可權,可以把這個選項設為0000. \fB注意\fR,能訪問samba伺服器的使用者透過其它方法也可以很容易地繞過這個限制,所以這個引數只對獨立工作的應用系統來說有用.很多系統管理的管理員都會把它設為預設的0000. 參見\fI directory security mask\fR, \fIsecurity mask\fR, \fIforce security mode \fR 引數。 預設設定: \fBforce directory security mode = 0\fR 示例: \fBforce directory security mode = 700\fR .TP force group (S) 這個選項指定一個UNIX組, 所有連線到服務上的使用者都被強迫使用這個組作為"主組". 所有訪問檔案的使用者都使用這個組的訪問許可權做許可權檢查. 因此, 透過分配檔案和目錄的訪問許可權給這個使用者組, Samba的管理員可以限制或允許對共享檔案的訪問. 在samba 2.0.5及更新的版本中這個選項已經按下面的方法有了一些擴充套件功能.如果在此列出的組名有一個'+'字元加在名稱前的話,當前使用者正在訪問的共享資源只有初始組被預設分配到這個組中,而可能的情況是使用者已經是其它組成員了.這樣,管理員可以決定只有在特殊組裡的使用者才能以設定的組身份建立檔案,更有益於所有權分配管理.例如,設定\fIforce group = +sys\fR的話,只有在sys組裡的使用者才能在訪問samba共享資源時擁有預設的初始組標識.而其它所有使用者保留他們原始的組標識. 如果又設定了 \fIforce user\fR選項的話,\fIforce group\fR選項中指定的組將會越過在 \fIforce user\fR中指定的初始組. If the \fIforce user\fR parameter is also set the group specified in \fIforce group\fR will override the primary group set in \fIforce user\fR\&. 參見 \fIforce user\fR選項. 預設設定: \fBno forced group\fR 示例: \fBforce group = agroup\fR .TP force security mode (S) 此選項控制NT使用者透過本地NT安全對話方塊可以操作哪些目錄上的unix許可權位. 此選項以掩碼('or')來實現許可權位的改變,所以它強制了任何掩碼中使用者可以更改的位.實際上,當在修改目錄的安全性時,這個掩碼中的一個0位可以作為一組使用者已經設為'on'的位來看待. 如果沒有明確設定的話,這個選項會用與force create mode選項同樣的值.要允許使用者在檔案上可以修改所有的user/group/world許可權,可以把這個選項設為000. \fB注意\fR,能訪問samba伺服器的使用者透過其它方法可以很容易地繞過這個限制,所以這個選項對獨立工作的系統來說才有用的.很多系統管理的管理員都會把它設為預設的0000. 參見\fI force directory security mode\fR, \fIdirectory security mask\fR, \fI security mask\fR 引數。 預設設定: \fBforce security mode = 0\fR 示例: \fBforce security mode = 700\fR .TP force user (S) 這個選項指定一個UNIX使用者的名字, 所有連線到服務上的使用者的預設名字就使用這個名字. (由於許可權的原因)在共享檔案時這個選項是有用的.你必須小心使用這個選項, 它有可能帶來安全上的問題. 這個選項只有當一個連線建立起來後才有用. 在建立連線的使用, 使用者還是必須有合法的使用者名稱和口令. 一旦連線建立起來, 所有的操作將強迫以這個名字進行, 而不管它是以什麼名字登入的. samba 2.0.5和更新的版本中這個選項會導致使用者的初始組被作為所有檔案操作的初始組.2.0.5以前的初始組被允許作為聯接使用者的初始組(這是個bug) 參見 \fIforce group\fR 選項。 預設設定: \fBno forced user\fR 示例: \fBforce user = auser\fR .TP fstype (S) 這個選項允許管理員設定一個字串說明共享的檔案系統的型別, 當客戶端有查詢時, \fBsmbd\fR(8)將這個字串作為正在使用的檔案系統的型別報告給客戶端. 為了和\fIWindows NT\fR相容預設值設定是\fBNTFS\fR, 當然,如果必要的話,也可以改變為其它的字串,例如\fBSamba\fR或\fBFAT\fR. 預設設定: \fBfstype = NTFS\fR 示例: \fBfstype = Samba\fR .TP get quota command (G) The \fBget quota command\fR should only be used whenever there is no operating system API available from the OS that samba can use\&. This parameter should specify the path to a script that queries the quota information for the specified user/group for the partition that the specified directory is on\&. Such a script should take 3 arguments: directory type of query uid of user or gid of group The type of query can be one of : 1 - user quotas 2 - user default quotas (uid = -1) 3 - group quotas 4 - group default quotas (gid = -1) This script should print its output according to the following format: Line 1 - quota flags (0 = no quotas, 1 = quotas enabled, 2 = quotas enabled and enforced) Line 2 - number of currently used blocks Line 3 - the softlimit number of blocks Line 4 - the hardlimit number of blocks Line 5 - currently used number of inodes Line 6 - the softlimit number of inodes Line 7 - the hardlimit number of inodes Line 8(optional) - the number of bytes in a block(default is 1024) 參見 \fIset quota command\fR 選項。 預設設定: \fBget quota command = \fR 示例: \fBget quota command = /usr/local/sbin/query_quota\fR .TP getwd cache (G) 這是一個性能調節選項. 當這個選項允許時, 一個高速緩衝演算法將被用來減少呼叫"getwd()"的時間. 這個選項對效能會產生很大的影響, 特別是在\fIwide links\fR選項設為\fBno\fR的時候. 預設設定: \fBgetwd cache = yes\fR .TP group (S) 與 \fIforce group\fR 同義。 .TP guest account (G,S) 這是一個用來訪問服務的使用者名稱(作為客戶來訪賬戶,區別於系統上的使用者), 當然, 被訪問的服務必須先設定了選項fI guest ok\fR. 這個賬戶所擁有的所有權利都會反映到以"訪問客戶(guest)"身份連線進來的客戶身上. 典型的, 這個客戶必須在passwd檔案中存在, 但是沒有有效的登入許可權.通常系統中存在著名為"ftp"的賬戶,把這個賬戶名使用在這裡是個好主意.注意:如果一個服務指定了一個專用的訪問使用者名稱,這個專用名將代替這裡的使用者名稱. 在某些系統上,預設的訪問使用者名稱"nobody"賬戶可能不能列印.如果遇到這種情況,請使用其它的賬戶名(例如ftp)。想要測試這種情況,可以試著用來訪賬戶登入(可以用\fBsu -\fR命令),然後,使用系統列印命令\fBlpr\fR(1)或\fBlp\fR(1). 這個引數不接受%宏,因為Samba系統的很多元件要正確工作都需要這個值是一個常量。 預設設定: \fB編譯時指定,通常是"nobody"\fR 示例: \fBguest account = ftp\fR .TP guest ok (S) 如果一個服務的這個選項的值設為\fByes\fR, 那末, 連線到這個服務不需要口令, 許可權設定為\fI guest account\fR的許可權. 這個選項抵消了設定 \fIrestrict anonymous\fR = 2 的好處。 參見下面的\fI security\fR來獲得更多資訊。 預設設定: \fBguest ok = no\fR .TP guest only (S) 如果一個服務的這個選項設定為 \fByes\fR, 那末, 只有客戶(guest)訪問被允許, 也就是說, 不允許以其他使用者的身份訪問.如果沒有設定\fIguest ok\fR選項, 則此選項無效. 參見下面的\fI security\fR 引數來獲得更多資訊。 預設設定: \fBguest only = no\fR .TP hide dot files (S) 這是一個布林值選項. 控制檔名最前面一個字元為"."的檔案是否表現為隱含檔案(UNIX檔案系統中, 最前面為"."的檔案是隱含檔案). 預設設定: \fBhide dot files = yes\fR .TP hide files (S) 這是一個隱藏檔案或目錄的列表.這些檔案不能被看見但是能被訪問.列表中的檔案或目錄將被賦予DOS下的"隱藏"屬性. 每個條目必須以"/"分隔以便允許在條目中使用空格.可以使用DOS風格的萬用字元"*"和"?"匹配多個目錄和檔案。 每一個條目必須使用UNIX格式的路徑,而不是DOS格式的路徑,同時,不能包含UNIX路徑分隔符"/". 注意:大小寫敏感的特性也適用於隱含檔案. 設定這個選項會影響Samba的效能,它會迫使系統檢查所有的檔案和目錄以確定是否與它的所要尋找的專案匹配. 參見 \fIhide dot files\fR, \fI veto files\fR 和 \fIcase sensitive\fR. 預設設定: \fB沒有隱藏檔案\fR 示例: \fBhide files = /.*/DesktopFolderDB/TrashFor%m/resource.frk/\fR 上面的例子中的檔案從Thursby共享出來,給Macintosh的SMB客戶端(DAVE),供內部使用,仍然隱藏了"."打頭的檔案. .TP hide local users (G) This parameter toggles the hiding of local UNIX users (root, wheel, floppy, etc) from remote clients\&. 預設設定: \fBhide local users = no\fR .TP hide special files (S) This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings\&. 預設設定: \fBhide special files = no\fR .TP hide unreadable (S) This parameter prevents clients from seeing the existance of files that cannot be read\&. Defaults to off\&. 預設設定: \fBhide unreadable = no\fR .TP hide unwriteable files (S) This parameter prevents clients from seeing the existance of files that cannot be written to\&. Defaults to off\&. Note that unwriteable directories are shown as usual\&. 預設設定: \fBhide unwriteable = no\fR .TP homedir map (G) 如果\fInis homedir \fR選項的值為\fByes\fR,同時, \fBsmbd\fR(8)也作為win95/98的\fI登入伺服器\fR,那麼,這個選項指明一個NIS(或者YP)對映.指向使用者主目錄所在的伺服器.目前,只認識Sun的auto.home對映格式.對映格式如下: \fBusername server:/some/file/system\fR 程式從":"號前取得伺服器名字.將來也許會有更好的解釋系統來處理不同的對映格式,當然,也包括Amd(另一種自動裝載方式)對映. 需要系統中有一個執行的NIS客戶來使這個選項工作。 參見 \fInis homedir\fR , \fIdomain logons\fR . 預設設定: \fBhomedir map = <空字串>\fR 示例: \fBhomedir map = amd.homedir\fR .TP host msdfs (G) If set to \fByes\fR, Samba will act as a Dfs server, and allow Dfs-aware clients to browse Dfs trees hosted on the server\&. 參見 \fI msdfs root\fR share level 選項。 For more information on setting up a Dfs tree on Samba, refer to ???\&. 預設設定: \fBhost msdfs = no\fR .TP hostname lookups (G) Specifies whether samba should use (expensive) hostname lookups or use the ip addresses instead\&. An example place where hostname lookups are currently used is when checking the \fBhosts deny\fR and \fBhosts allow\fR\&. 預設設定: \fBhostname lookups = yes\fR 示例: \fBhostname lookups = no\fR .TP hosts allow (S) 與\fIallow hosts\fR 同義. 這個選項是一個由逗號,空格或者tab字元隔開的一組主機名.列入其中的主機才允許訪問. 如果該選項出現在[global]段中,它會作用於所有服務而忽略單個服務所作的不同設定. 你可以用ip地址或主機名來指定主機.比如,你可以用類似 \fBallow hosts = 150.203.5. \fR來限定只允許訪問在這個c類子網中的主機.\fIhosts_access(5)\fR中詳細描述了關於這個選項設定的完整語法.注意到你的系統中也許沒有這個參考手冊,這裡也作一個簡單的說明. 注意,本機地址127.0.0.1 總是允許連線,除非在\fIhosts deny\fR 選項中加以禁止. 你也可以使用子網號/子網掩碼對來指定主機.如果你的網路支援網路組,你還可以用網路組名來指定組內的主機.\fBEXCEPT\fR(除了...)關鍵字可以在使用了萬用字元的情況下起到限定作用. Example 1: 允許150.203.*.* 中除了一臺機器之外的所有IP訪問 \fBhosts allow = 150.203. EXCEPT 150.203.6.66\fR Example 2: 允許滿足給定的子網號/子網掩碼的IP訪問 \fBhosts allow = 150.203.15.0/255.255.255.0\fR Example 3: 允許一系列主機訪問 \fBhosts allow = lapland, arvidsjaur\fR Example 4: 允許NIS網路組"foonet"訪問,但是禁止其中的一臺主機 \fBhosts allow = @foonet\fR \fBhosts deny = pirate\fR 注意,訪問時還是需要有適當的使用者級口令. 參見\fBtestparm\fR(1) 來檢測主機是否可以按照你希望的方式被訪問. 預設設定: \fBnone (也就是說,所有機器都可以訪問)\fR 示例: \fBallow hosts = 150.203.5. myhost.mynet.edu.au\fR .TP hosts deny (S) \fIhosts allow\fR選項的反義詞.所有被列入這個選項中的主機的服務都\fB不\fR允許被訪問,除非這個被訪問的服務定義了自己的允許列表.當允許的主機列表和禁止的主機列表發生衝突的時候,\fIallow\fR優先. 預設設定: \fBnone (沒有禁止訪問的主機)\fR 示例: \fBhosts deny = 150.203.4. badhost.mynet.edu.au\fR .TP hosts equiv (G) 如果這個選項值不是空字串,就指定了一個檔名.這個檔案中列出了可以不用口令就允許訪問的主機和使用者的名字. 不要把這個選項和\fIhosts allow\fR 搞混了,那是關於控制主機對服務的訪問的,用於管理對來訪者的服務.而\fI hosts equiv\fR是用於支援那些不對samba提供口令的NT客戶的. 注意:使用\fIhosts equiv \fR 可能會成為一個很大的安全漏洞.這是因為你相信發起訪問的PC提供了正確的使用者名稱.找一臺PC來提供一個假的使用者名稱是很容易的.我建議你只有在完全明白你在幹什麼的情況下才使用\fIhosts equiv\fR選項,或者在你自己的家裡(那裡有你可以完全信任的配偶和孩子)使用它.僅僅是在你\fB完全\fR可以信任他們的時候才用 :-) 預設設定: \fBno host equivalences\fR 示例: \fBhosts equiv = /etc/hosts.equiv\fR .TP idmap backend (G) The purpose of the idmap backend parameter is to allow idmap to NOT use the local idmap tdb file to obtain SID to UID / GID mappings, but instead to obtain them from a common LDAP backend\&. This way all domain members and controllers will have the same UID and GID to SID mappings\&. This avoids the risk of UID / GID inconsistencies across UNIX / Linux systems that are sharing information over protocols other than SMB/CIFS (ie: NFS)\&. 預設設定: \fBidmap backend = <空字串>\fR 示例: \fBidmap backend = ldap:ldap://ldapslave.example.com\fR .TP idmap gid (G) The idmap gid parameter specifies the range of group ids that are allocated for the purpose of mapping UNX groups to NT group SIDs\&. This range of group ids should have no existing local or NIS groups within it as strange conflicts can occur otherwise\&. The availability of an idmap gid range is essential for correct operation of all group mapping\&. 預設設定: \fBidmap gid = <空字串>\fR 示例: \fBidmap gid = 10000-20000\fR .TP idmap uid (G) The idmap uid parameter specifies the range of user ids that are allocated for use in mapping UNIX users to NT user SIDs\&. This range of ids should have no existing local or NIS users within it as strange conflicts can occur otherwise\&. 預設設定: \fBidmap uid = <空字串>\fR 示例: \fBidmap uid = 10000-20000\fR .TP include (G) 這個選項使得你可以把一個配置檔案插入到另一個配置檔案中去.這只是一種文字替換,就在好像被插入的檔案的那個位置直接寫入那個插入檔案一樣. 它支援標準替換,除\fI%u \fR, \fI%P\fR 和 \fI%S\fR以外. 預設設定: \fB沒有包含其他檔案\fR 示例: \fBinclude = /usr/local/samba/lib/admin_smb.conf\fR .TP inherit acls (S) This parameter can be used to ensure that if default acls exist on parent directories, they are always honored when creating a subdirectory\&. The default behavior is to use the mode specified when creating the directory\&. Enabling this option sets the mode to 0777, thus guaranteeing that default directory acls are propagated\&. 預設設定: \fBinherit acls = no\fR .TP inherit permissions (S) The permissions on new files and directories are normally governed by \fI create mask\fR, \fIdirectory mask\fR, \fIforce create mode\fR and \fIforce directory mode\fR but the boolean inherit permissions parameter overrides this\&. New directories inherit the mode of the parent directory, including bits such as setgid\&. New files inherit their read/write bits from the parent directory\&. Their execute bits continue to be determined by \fImap archive\fR , \fImap hidden\fR and \fImap system\fR as usual\&. Note that the setuid bit is \fBnever\fR set via inheritance (the code explicitly prohibits this)\&. This can be particularly useful on large systems with many users, perhaps several thousand, to allow a single [homes] share to be used flexibly by each user\&. 參見 \fIcreate mask \fR, \fI directory mask\fR, \fIforce create mode\fR and \fIforce directory mode\fR \&. 預設設定: \fBinherit permissions = no\fR .TP interfaces (G) 這個選項允許你超越預設的Samba用來處理瀏覽,名字註冊和其他NBT網路流量的網路藉口列表. 預設情況Samba向核心查詢所有活動的介面列表並且使用除了127.0.0.1 之外的介面. 這個選項的內容是一個介面字串的列表, 每個字串可以是下列任何一種格式: 一個網路介面名(例如eth0).它可以包含象在shell風格的萬用字元如eth*來匹配任何以子字元品"eth"起始的網路介面. 一個IP地址.這種情況下,網路掩碼是從核心中獲得的介面列表中檢測的. 一個IP/掩碼對. 一個廣播地址/掩碼對. "mask"選項可以是一個位長度(例如C類網路可以是24)或者是以點分格式出現的完整網路地址掩碼. "IP"選項可以是完整點分十六進位制IP地址或是按作業系統通常使用的主機名解析機制查詢的主機名. 例如,下面這一行: \fBinterfaces = eth0 192.168.2.10/24 192.168.3.10/255.255.255.0\fR 將配置三個網路介面,對應eth0裝置以及IP地址192.168.2.10 和192.168.3.10。後兩個介面的網路掩碼將設定為255.255.255.0。 參見\fIbind interfaces only\fR. 預設設定: \fB除了127.0.0.1 之外的所有活動介面 that are broadcast capable\fR .TP invalid users (S) 這是一個不允許在這個服務上登入的使用者的名單.這的確是一個非常嚴格的(\fBparanoid\fR)檢查,確保任何可能的不適當的設定都不會破壞你的系統的安全. 以@開頭的使用者名稱首先被當作NIS網路組名(如果你的系統支援NIS的話),如果在NIS的網路組資料庫中找不到這個組,那麼這個名字就被當作一個UNIX使用者組名來處理. 以+開頭的使用者名稱僅表示UNIX使用者組名,以&開頭的使用者名稱僅表示NIX網路組名(這個設定要求你的系統中有NIS在執行).'+'和'&'符號可以以任何順序出現在使用者組名前,因此,你可以指定對這個名稱的查詢次序,比如\fI+&group\fR表示先在UNIX使用者組中查詢,再在NIS網路組中查詢,而\fI&+group\fR則相反,先在NIX網路組中查詢,再到UNIX使用者組中查詢.(這與使用@字首的效果相同). 當前的服務名可以用\fI%S\fR來表示,這在[homes]段中是很有用的. 參見 \fIvalid users \fR. 預設設定: \fB沒有非法使用者\fR 示例: \fBinvalid users = root fred admin @wheel\fR .TP keepalive (G) 這個選項是一個整數,它表示用於\fIkeepalive\fR包間隔的秒數.如果這個選項是0,那麼就不傳送保持連線的包.傳送保持連線的包使得主機可以確定客戶端是否還在響應。 通常,如果用於連線的socket使用了SO_KEEPALIVE屬性設定(參見\fIsocket options\fR),那麼傳送保持連線的包是不需要的.基本上,除非你遇到了某些困難,這個選項是用不到的. 預設設定: \fBkeepalive = 300\fR 示例: \fBkeepalive = 600\fR .TP kernel change notify (G) This parameter specifies whether Samba should ask the kernel for change notifications in directories so that SMB clients can refresh whenever the data on the server changes\&. This parameter is only usd when your kernel supports change notification to user programs, using the F_NOTIFY fcntl\&. 預設設定: \fBYes\fR .TP kernel oplocks (G) 在支援基於核心的 \fIoplocks\fR(opportunistic lock)的UNIX系統上(目前只有IRIX 和Linux2.4核心),這個選項允許開啟或關閉對這個特性的利用. 核心機會性鎖定操作使得本地UNIX程序或NFS對檔案進行操作時可以鎖定(凍結)\fBsmbd\fR(8)對同一個檔案的\fIoplocks \fR操作.這可以保持SMB/CIFS,NFS和本地檔案操作之間的資料一致性.(這是一個很cool的特性哦 :-) 如果你的系統支援這個設定,預設設定就是\fBon\fR(開啟),如果系統不支援,預設設定就是\fBOff\fR(關閉).你根本不必去管這個選項. 參見 \fIoplocks\fR 和 \fIlevel2 oplocks \fR 引數. 預設設定: \fBkernel oplocks = yes\fR .TP lanman auth (G) This parameter determines whether or not \fBsmbd\fR(8) will attempt to authenticate users using the LANMAN password hash\&. If disabled, only clients which support NT password hashes (e\&.g\&. Windows NT/2000 clients, smbclient, etc\&.\&.\&. but not Windows 95/98 or the MS DOS network client) will be able to connect to the Samba host\&. The LANMAN encrypted response is easily broken, due to it's case-insensitive nature, and the choice of algorithm\&. Servers without Windows 95/98 or MS DOS clients are advised to disable this option\&. Unlike the \fBencypt passwords\fR option, this parameter cannot alter client behaviour, and the LANMAN response will still be sent over the network\&. See the \fBclient lanman auth\fR to disable this for Samba's clients (such as smbclient) If this option, and \fBntlm auth\fR are both disabled, then only NTLMv2 logins will be permited\&. Not all clients support NTLMv2, and most will require special configuration to us it\&. Default : \fBlanman auth = yes\fR .TP large readwrite (G) This parameter determines whether or not \fBsmbd\fR(8) supports the new 64k streaming read and write varient SMB requests introduced with Windows 2000\&. Note that due to Windows 2000 client redirector bugs this requires Samba to be running on a 64-bit capable operating system such as IRIX, Solaris or a Linux 2\&.4 kernel\&. Can improve performance by 10% with Windows 2000 clients\&. Defaults to on\&. Not as tested as some other Samba code paths\&. 預設設定: \fBlarge readwrite = yes\fR .TP ldap admin dn (G) The \fIldap admin dn\fR defines the Distinguished Name (DN) name used by Samba to contact the ldap server when retreiving user account information\&. The \fIldap admin dn\fR is used in conjunction with the admin dn password stored in the \fIprivate/secrets\&.tdb\fR file\&. See the \fBsmbpasswd\fR(8) man page for more information on how to accmplish this\&. .TP ldap delete dn (G) This parameter specifies whether a delete operation in the ldapsam deletes the complete entry or only the attributes specific to Samba\&. 預設設定: \fBldap delete dn = no\fR .TP ldap filter (G) 這個選項指定了RFC2254相容的LDAP搜尋過濾器。預設對所有匹配\fBsambaAccount\fR物件類的條目進行登入名和 \fBuid\fR 屬性之間的匹配。注意這個過濾器只應當返回一個條目. 預設設定: \fBldap filter = (&(uid=%u)(objectclass=sambaAccount))\fR .TP ldap group suffix (G) This parameters specifies the suffix that is used for groups when these are added to the LDAP directory\&. If this parameter is unset, the value of \fIldap suffix\fR will be used instead\&. 預設設定: \fBnone\fR 示例: \fBdc=samba,ou=Groups\fR .TP ldap idmap suffix (G) This parameters specifies the suffix that is used when storing idmap mappings\&. If this parameter is unset, the value of \fIldap suffix\fR will be used instead\&. 預設設定: \fBnone\fR 示例: \fBou=Idmap,dc=samba,dc=org\fR .TP ldap machine suffix (G) It specifies where machines should be added to the ldap tree\&. 預設設定: \fBnone\fR .TP ldap passwd sync (G) This option is used to define whether or not Samba should sync the LDAP password with the NT and LM hashes for normal accounts (NOT for workstation, server or domain trusts) on a password change via SAMBA\&. The \fIldap passwd sync\fR can be set to one of three values: \fIYes\fR = Try to update the LDAP, NT and LM passwords and update the pwdLastSet time\&. \fINo\fR = Update NT and LM passwords and update the pwdLastSet time\&. \fIOnly\fR = Only update the LDAP password and let the LDAP server do the rest\&. 預設設定: \fBldap passwd sync = no\fR .TP ldap port (G) 這個選項只有在編譯時配置了"--with-ldap"選項的情況下才可用. 這個選項控制用於和LDAP伺服器通訊的tcp埠號。預設應用標準的LDAP埠636。 參見: ldap ssl Default : \fBldap port = 636 ; 如果 ldap ssl = on\fR Default : \fBldap port = 389 ; 如果 ldap ssl = off\fR .TP ldap server (G) 這個選項只有在編譯時配置了"--with-ldapsam"選項的情況下才可用. 這個選項應當包含ldap目錄伺服器的FQDN,用來查詢和定位使用者帳戶資訊。 Default : \fBldap server = localhost\fR .TP ldap ssl (G) This option is used to define whether or not Samba should use SSL when connecting to the ldap server This is \fBNOT\fR related to Samba's previous SSL support which was enabled by specifying the \fB--with-ssl\fR option to the \fIconfigure\fR script\&. The \fIldap ssl\fR can be set to one of three values: \fIOff\fR = Never use SSL when querying the directory\&. \fIStart_tls\fR = Use the LDAPv3 StartTLS extended operation (RFC2830) for communicating with the directory server\&. \fIOn\fR = Use SSL on the ldaps port when contacting the \fIldap server\fR\&. Only available when the backwards-compatiblity \fB--with-ldapsam\fR option is specified to configure\&. See \fIpassdb backend\fR Default : \fBldap ssl = start_tls\fR .TP ldap suffix (G) 指定使用者和機器帳號從哪裡加入樹中。可以被\fBldap user suffix\fR和\fBldap machine suffix\fR選項越過。它也用作所有ldap搜尋的base dn。 預設設定: \fBnone\fR .TP ldap user suffix (G) This parameter specifies where users are added to the tree\&. If this parameter is not specified, the value from \fBldap suffix\fR\&. 預設設定: \fBnone\fR .TP level2 oplocks (S) 這個引數控制了是否Samba在一個共享上支援第二級(只讀)oplocks。 2級,或者只讀oplocks允許Windows NT客戶在檔案中可以保持一個oplocks,一旦第二個使用者請求同一檔案時可以從讀寫oplocks級降為只讀oplocks(而不是像傳統的做法,保持唯一的oplocks,在第二次開啟時釋放所有的oplocks).這樣就可以允許支援2級oplocks的檔案開啟者快取用於只讀的檔案(也就是說,他們的寫和鎖定請求不可能被緩衝),並且使只讀檔案的大量訪問提升效能(例如.exe檔案). 一旦在擁有隻讀oplocks的客戶中有一位對檔案進行了寫操作,所有的客戶都會被通知(不需要回復及等待), told to break their oplocks to "none",然後刪除所有read-ahead caches. 推薦開啟這個選項,為共享的可執行程式提高訪問速度。 更多關於2級oplocks的討論請檢視CIFS的規約. 當前,如果使用了\fIkernel oplocks\fR的話,就不會認可2級oplocks(即使把那個選項設為\fByes\fR也沒用).還要注意,\fIoplocks\fR 選項必須在共享上被設成\fByes\fR才有效果. 參見 \fIoplocks\fR 和 \fIkernel oplocks\fR 選項。 預設設定: \fBlevel2 oplocks = yes\fR .TP lm announce (G) 這個選項決定\fBnmbd\fR(8)是否產生"Lanman宣告廣播",OS/2的客戶端需要這個廣播用以在它們的瀏覽列表裡看到Samba伺服器.這個選項有3個值:\fByes\fR、\fBno\fR、\fBauto\fR.預設值是\fBauto\fR.如果這值為\fBno\fR,Samba將不會產生這種廣播.如果設定為\fByes\fR,Samba將以\fIlm interval\fR選項的值為頻率產生這種廣播.如果設定為\fBauto\fR,Samba並不發出這類廣播,但是偵聽他們.如果收到這樣的廣播,它就開始傳送這種廣播,頻率還是以\fIlm interval\fR選項設定的為準. 參見 \fIlm interval\fR. 預設設定: \fBlm announce = auto\fR 示例: \fBlm announce = yes\fR .TP lm interval (G) 如果Samba設定為產生"Lanman宣告廣播(給OS/2客戶端使用,參見\fIlm announce\fR選項).那麼,這裡的選項設定了以秒為單位的發生頻率.如果這個選項設定為"0",則不管\fIlm announce\fR選項的值,永遠不會發出任何"Lanman宣告廣播". 參見\fIlm announce\fR. 預設設定: \fBlm interval = 60\fR 示例: \fBlm interval = 120\fR .TP load printers (G) 這個布林值控制是否在"printcap"檔案中的所有印表機將會被預設的安裝到Samba環境,並且可以被瀏覽.參見"printers"段獲得更多細節. 預設設定: \fBload printers = yes\fR .TP local master (G) 這個選項允許\fBnmbd\fR(8)試著去成為本地子網的主控瀏覽器.如果選項值為\fBno\fR,\fB nmbd\fR不會去爭取這個權利.在預設情況下,這個值為\fByes\fR.設定這個值為\fByes\fR,並不意味著\fBbecome\fR 就一定會成為本地的主瀏覽器,只是意味著\fBbecome\fR 會參加成為主瀏覽器的選舉. 設定這個值為 \fBno\fR 將使 \fBnmbd\fR \fB永遠不會\fR 成為主控瀏覽器。 預設設定: \fBlocal master = yes\fR .TP lock dir (G) 與 \fI lock directory\fR 同義. .TP lock directory (G) 這個選項指出"加鎖檔案"放置的目錄.加鎖檔案用以實現最大連線數\fImax connections\fR. 預設設定: \fBlock directory = ${prefix}/var/locks\fR 示例: \fBlock directory = /var/run/samba/locks\fR .TP locking (S) 這個選項控制當客戶端發出鎖定請求時,伺服器是否執行"鎖定". 如果 \fBlocking = no\fR ,所有的鎖定請求和解除鎖定請求將表現為成功執行.對鎖定的查詢將會顯示沒有鎖定. 如果\fBlocking = yes\fR 伺服器將執行真正的鎖定。 這個選項\fB可能\fR對只讀檔案系統有用,因為它\fB可能\fR不需要鎖定(例如:CDROM).即使在這種情況下,我們也不真正推薦使用\fBno\fR. 要特別小心,不管是全域性的關閉這個選項或者在某個服務上關閉這個選項,都有可能由於缺少鎖定而導致資料損壞.其實,你根本就不需要設定這個選項. 預設設定: \fBlocking = yes\fR .TP lock spin count (G) This parameter controls the number of times that smbd should attempt to gain a byte range lock on the behalf of a client request\&. Experiments have shown that Windows 2k servers do not reply with a failure if the lock could not be immediately granted, but try a few more times in case the lock could later be aquired\&. This behavior is used to support PC database formats such as MS Access and FoxPro\&. 預設設定: \fBlock spin count = 3\fR .TP lock spin time (G) The time in microseconds that smbd should pause before attempting to gain a failed lock\&. See \fIlock spin count\fR for more details\&. 預設設定: \fBlock spin time = 10\fR .TP log file (G) 這個選項允許設定其它的檔名字來替代Samba日誌檔案(也就是除錯檔案). 這個選項支援標準的檔名代換變數,允許方便的為每個使用者或者機器設定專用的日誌檔案. 示例: \fBlog file = /usr/local/samba/var/log.%m\fR .TP log level (G) 這個值(字串)允許在\fIsmb.conf\fR裡定義除錯水平(記錄水平).This parameter has been extended since the 2.2.x series, now it allow to specify the debug level for multiple debug classes. 這給系統配置帶來更大的靈活性. 預設的除錯水平將在命令列裡定義,如果沒有定義,除錯水平為零. 示例: \fBlog level = 3 passdb:5 auth:10 winbind:2\fR .TP logon drive (G) 這個選項設定一個本地路徑(可以理解為網路對映盤),當登入時,使用者的主目錄就連線到這個本地路徑(參見\fIlogon home\fR). 注意:這個選項只有在Samba是登入伺服器時才有用. 預設設定: \fBlogon drive = z:\fR 示例: \fBlogon drive = h:\fR .TP logon home (G) 當Win95/98或Win NT工作站登入到Samba PDC時,它們的主目錄的位置.設定了這個選項,就允許在(DOS)提示符下使用形如: C:\\> \fBNET USE H: /HOME\fR 這樣的命令。 這個選項支援標準的命令選項替換,方便為每個使用者或者機器提供登入指令碼. This parameter can be used with Win9X workstations to ensure that roaming profiles are stored in a subdirectory of the user's home directory\&. This is done in the following way: \fBlogon home = \\%N\%U\profile\fR This tells Samba to return the above string, with substitutions made when a client requests the info, generally in a NetUserGetInfo request\&. Win9X clients truncate the info to \\\\server\\share when a user does \fBnet use /home\fR but use the whole string when dealing with profiles\&. Note that in prior versions of Samba, the \fIlogon path\fR was returned rather than \fIlogon home\fR\&. This broke \fBnet use /home\fR but allowed profiles outside the home directory\&. The current implementation is correct, and can be used for profiles if you use the above trick\&. 注意,這個選項只在Samba被設定成為登入伺服器logon server時才起作用. 預設設定: \fBlogon home = "\\%N\%U"\fR 示例: \fBlogon home = "\\remote_smb_server\%U"\fR .TP logon path (G) 這個選項指定了存放roaming profile(WindowsNT的NTuser.dat 等檔案)的使用者目錄.Contrary to previous versions of these manual pages, it has nothing to do with Win 9X roaming profiles. To find out how to handle roaming profiles for Win 9X system, see the \fIlogon home\fR parameter. 這個選項支援標準替換,允許你為每一個使用者或機器設定不同的登入指令碼.它也可以指定那些顯示在Windows NT客戶端上的"應用程式資料"(\fI桌面\fR,\fI開始選單\fR,\fI網路上的芳鄰\fR和\fI程式\fR等資料夾和他們的內容). 指定的共享資源和路徑必須是使用者可讀的,這樣,設定的選項和目錄才能被Windows NT客戶端裝載使用.這個共享資源在使用者第一次登入時必須是可寫的,這樣Windows NT客戶端才能建立NTuser.dat檔案及其他目錄. 然後,這些目錄以及其中的任何內容都可以根據需要設定為只讀的.把NTuser.dat檔案設定成只讀是不明智的,你應該把它改名成NTuser.man(一個強制使用(\fBMAN\fRdatory)的user.dat)來達到同樣的目的. Windows終端有時候即使沒有使用者登入也會保持對[homes]共享資源的連線.因此,logon path不能包含對homes共享資源的任何參照(也就是說,把這個選項設定成類似\\\\%N\\HOMES\\profile_path會引起問題). 這個選項支援標準替換,允許你為不同的機器或使用者設定不同的登入指令碼. 注意,這個選項只有在Samba被設定成為登入伺服器logon server的時候才起作用. 預設設定: \fBlogon path = \\\\%N\\%U\\profile\fR 示例: \fBlogon path = \\\\PROFILESERVER\\PROFILE\\%U\fR .TP logon script (G) 這個選項指明,當一個使用者成功的登入後,將會自動下載到本地執行的指令碼檔案,這個指令碼檔案可能是一個批處理檔案(.bat)或者一個NT命令檔案(.cmd).這個指令碼檔案必須使用DOS風格的回車/換行(CR/LF)來結束每一行,因此,我們推薦使用DOS風格的文字編輯器來建立這個檔案. 指令碼檔案的存放位置必須是相對於[netlogon]服務中指明的目錄路徑,舉例來說,如果[netlogon]服務指定了了一個\fIpath\fR是\fI/usr/local/samba/netlogon\fR,而\fBlogon script \fR = STARTUP.BAT, 那麼將要下載到客戶端執行的檔案的實際存放位置是: \fI/usr/local/samba/netlogon/STARTUP.BAT\fR 登入指令碼的內容包含什麼,完全由你決定.我們建議包含這個指令:\fBNET TIME \\SERVER /SET /YES\fR,它強迫每一臺機器的時間和伺服器的時間同步(以伺服器的時間為準);另一個建議是對映公共工具盤:\fBNET USE U:\\\\SERVER\\"公共工具目錄"\fR 例如: .nf NET USE Q:\\SERVER\ISO9001_QA .fi 注意:在一個有安全要求的系統環境中,特別重要的是要記住不要允許客戶在[netlogon]上有寫的許可權,也不要給以客戶改寫登入指令碼檔案的權利.如果允許客戶隨意的修改,安全規則就給撕裂了一個口子. 這個選項支援標準的置換規則,允許你為每個不同的使用者或機器定製不同的登入指令碼. 注意,這個選項只有在Samba設定為登入伺服器時才起作用. 預設設定: \fBno logon script defined\fR 示例: \fBlogon script = scripts\%U.bat\fR .TP lppause command (S) 這個選項指定在伺服器上中斷指定的列印作業的列印或假離線列印操作所使用的指令. 這個指令應該是一個可以根據印表機名和作業號中斷列印作業的程式或指令碼.實現這個操作的一個辦法是使用作業優先順序,優先級別太低的作業不會被髮送到印表機上. 用\fI%p\fR置換可以取得印表機名,而\fI%j\fR會被列印作業號(一個整數)置換.在HPUX系統中(參見\fIprinting=hpux \fR),如果給lpq命令加上\fI-p%p\fR選項,列印作業會顯示其執行狀態,具體的說,如果作業的優先順序低於阻塞級別,它會顯示'PAUSED'狀態,反之,如果作業的優先順序等於或高於阻塞級別,它會顯示'SPOOLED'或'PRINTING'狀態. 注意,在這個設定中使用絕對路徑是一個好習慣,因為這個路徑有可能不在伺服器的PATH環境變數中. 參見 \fIprinting \fR parameter選項. 預設設定: 目前這個選項沒有預設設定,除非\fIprinting\fR選項設定\fBSYSV\fR,在這種情況下,預設參 數是: \fBlp -i %p-%j -H hold\fR 或者在\fIprinting\fR選項設定為\fBsoftq\fR時,預設選項是: \fBqstat -s -j%j -h\fR 在HPUX系統中的例子: \fBlppause command = /usr/bin/lpalt %p-%j -p0\fR .TP lpq cache time (G) 此選項控制了\fBlpq\fR資訊多長時間被緩衝一次,以防止頻繁呼叫\fBlpq\fR命令.每一次系統使用\fBlpq\fR命令會保留一個單獨的緩衝,所以如果不同的使用者分別使用了不同的\fBlpq\fR命令的話,他們不可能共享緩衝資訊. 緩衝檔案被存放在\fI/tmp/lpq.xxxx\fR檔案中,其中的xxxx是正在使用的\fBlpq\fR命令雜湊表. 這個選項的預設值是10秒,這就是說以前相同的\fBlpq\fR命令的緩衝內容將在週期為10秒內被使用.如果\fBlpq\fR命令非常慢的話,可以取稍大的值. 把這個值設為0就完全禁止了緩衝技術的使用. 參見 \fIprinting\fR 選項. 預設設定: \fBlpq cache time = 10\fR 示例: \fBlpq cache time = 30\fR .TP lpq command (S) 這個選項指定為了獲得\fBlpq\fR風格的印表機狀態資訊而要在伺服器上要執行的命令. 這個命令應該是一個只以印表機名作為選項並可以輸出印表機狀態資訊的程式或指令碼. 通常支援九種印表機狀態資訊:CUPS, BSD,AIX,LPRNG,PLP,SYSV,HPUX,QNX和SOFTQ.而這些正好覆蓋了大多數的UNIX系統.你可以用\fIprinting =\fR選項來控制到底要用哪種型別. 有些客戶端(特別是Windows for Workgroups)可能不能正確地向列印機發送聯接號以獲得狀態資訊.對此,伺服器會向客戶報告它所聯接的首個列印服務.這樣的情況只當聯接號傳送非法時才會發生. 如果使用\fI%p\fR變數的話,系統會在此處放置印表機名.否則在命令後放置印表機名. 注意,當伺服器不能獲得\fBPATH\fR變數的話,以絕對路徑來描述\fIlpq command\fR是個好習慣. 當與CUPS庫編譯連線時,不需要\fIlpq command\fR,因為smbd將使用庫呼叫來獲得列印佇列列表。 參見 \fIprinting \fR 選項. 預設設定: \fB依賴於 \fI printing\fR 的設定情況\fR 示例: \fBlpq command = /usr/bin/lpq -P%p\fR .TP lpresume command (S) 此選項指定為了繼續連續列印或假離線一個指定的列印任務時要在伺服器上執行的命令. 此命令應該是一個以印表機名和要恢復的列印任務號作為選項的程式或指令碼.參見\fIlppause command \fR引數。 如果使用\fI%p\fR變數的話,系統會在此處放置印表機名.用\fI%j\fR來代替列印任務號,當然是用整數形 式羅. 注意,當伺服器不能獲得PATH變數的話,以絕對路徑來描述\fIlpresume command\fR是個好習慣 參見 \fIprinting \fR 選項. 預設設定: 當前沒有預設設定,除非 \fIprinting\fR 選項是 \fBSYSV\fR, 此時預設是 \fBlp -i %p-%j -H resume\fR 或者如果\fIprinting\fR 選項是 \fBSOFTQ\fR, 那麼預設是: \fBqstat -s -j%j -r\fR HPUX的示例: \fBlpresume command = /usr/bin/lpalt %p-%j -p2\fR .TP lprm command (S) 此選項指定為了要刪除一個列印任務而需要在伺服器上執行的命令. 此命令應該是一個使用印表機名和列印任務號的程式或指令碼,並且執行它們可以刪掉列印任務. 如果使用\fI%p\fR變數的話,系統會在此處放置印表機名.用\fI%j\fR來代替列印任務號,當然是也用整數形式羅. 注意,當不能從伺服器獲得PATH變數的話,以絕對路徑來描述\fIlprm command\fR是個好習慣. 參見\fIprinting \fR 選項. 預設設定: \fB依賴於 \fIprinting \fR 選項設定\fR 示例 1: \fBlprm command = /usr/bin/lprm -P%p %j\fR 示例 2: \fBlprm command = /usr/bin/cancel %p-%j\fR .TP machine password timeout (G) 如果samba伺服器是Windows NT域成員的話(參見\fIsecurity=domain\fR選項),那麼執行中的smbd程序會週期性地試著改變儲存在叫做\fIprivate/secrets.tdb\fR的TDB中的MACHINE ACCOUNT PASSWORD.這個引數指定了密碼將多久更換一次,以秒為單位。預設值是一個星期(當然要以秒來表示),這與NT域成員伺服器是一樣的. 參見 \fBsmbpasswd\fR(8), 和 \fIsecurity = domain\fR 選項. 預設設定: \fBmachine password timeout = 604800\fR .TP magic output (S) 此選項指定了一個用magic指令碼輸出內容而建立的檔案的名稱,參見下面對\fImagic script\fR選項的描述. 警告:如果兩個客戶在同樣的目錄下用相同的\fImagic script\fR,輸出檔案內容是無法確定的. 預設設定: \fBmagic output = .out\fR 示例: \fBmagic output = myfile.txt\fR .TP magic script (S) 這個選項用來指定將被伺服器執行的檔案的名字,這個檔案如果已經開啟,那麼,當這個檔案關閉後伺服器同樣也可以執行.這樣就允許了一個UNIX指令碼可以傳送到samba主機,併為所連線的使用者執行. 以這種方式執行的指令碼將會在完成以後被刪除,只要許可權允許的話. 如果指令碼產生了輸出的話,這些資訊就被送到\fImagic output\fR選項指定的檔案中(見以上描述). 注意,一些命令直譯器不能解釋包含CR/LF而不是CR回車換行符的指令碼.magic指令碼必須是可以被執行的(\fB就象\fR在本地主機執行一樣),而有些指令碼在某些主機上或某些shell下可能會在dos客戶端進行過濾處理. magic指令碼仍處於\fB實驗\fR階段,所以\fB不能\fR對此完全依賴. 預設設定: \fB無。禁止使用magic script.\fR 示例: \fBmagic script = user.csh\fR .TP mangle case (S) 參見NAME MANGLING部分. 預設設定: \fBmangle case = no\fR .TP mangled map (S) 這個選項是用來直接對映那些不能在Windows/DOS上描述的unix檔名.不過並不經常出現這樣的情況,只有一些特殊的副檔名在DOS和UNIX之間才會不同,例如,HTML檔案在UNIX下通常都是\fI.html\fR,而在Windows/DOS下通常卻是\fI.htm\fR. 所以如果要將 \fIhtml\fR 對映為 \fIhtm\fR 你應當這樣: \fBmangled map = (*.html *.htm)\fR 有一個非常有用的經驗是刪掉在CDROM光碟上一些檔名後面討人厭的\fI;1\fR(只有在一些UNIX可以看到它們).為此可以這樣對映:(*;1 *;). 預設設定: \fI沒有 mangled map\fR 示例: \fBmangled map = (*;1 *;)\fR .TP mangled names (S) 這個選項控制是否要把UNIX下的非DOS檔名對映為DOS相容的形式("mangled")並使得它們可以查閱,或者簡單地忽略掉這些非DOS檔名. NAME MANGLING部分有更多關於如何控制這類處理的詳細資訊. 如果使用了這種對映,那麼其演算法就象下面這樣: 把檔名最後一個點符號前面首五個字母數字字元強制轉換成大寫,作為要對映名字的首五個字元. 在要對映名字的起始部分加上"~"符號,後面跟兩個字元的特殊序列字串,而這個序列字串是由原始的檔名而來(也就是:原檔名去掉最後的副檔名).只有當檔案的副檔名含有大寫字母或長於三個字元時,檔案的最後副檔名才被包含在雜湊計算中. 注意,如果你不喜歡'~'的話,可以用\fImangling char\fR選項來指定你想要的字元. 最後,副檔名部分的前三個字元會被保留,強制轉換到大寫並作為對映後名字的副檔名.最後的副檔名就是原始檔名中最後一個'.'右面的那部分.如果檔名中沒有'.',那麼對映後的檔名也沒有副檔名部分(除非用了"hidden files" - 參見後面的介紹). unix的檔名如果以點開始,那麼好比DOS中的隱藏檔案.這些檔案對映後的檔名就會拿掉點符號並用"___"來作為它的副檔名,而不管原來的副檔名是什麼("___"是三個下劃線). 大寫字母數字字元組成了兩位雜湊值. 如果目錄中的檔案與要對映的檔名使用了相同的前五位字元,這樣的演算法會導致名稱衝突,不過發生衝突的可能性是1/1300. 名稱對映允許當需要保留unix長檔名時在unix目錄與Windows/DOS之間複製檔案.從Windows/DOS中拷過來的unix檔案可以更換新的副檔名並保留同樣的主檔名.名稱對映並不會在轉換時更改什麼東西. 預設設定: \fBmangled names = yes\fR .TP mangled stack (G) 這個選項控制了對映檔名的數量,以便讓Samba伺服器\fBsmbd\fR(8)對其進行快取. 棧裡儲存了最近對映的基本檔名(副檔名只有在超過3個字元或者包含大寫字元時才會保留). 棧值設得稍大一些,對於對映unix的長檔名操作會更順利一些.但是,它會使目錄訪問變得更慢;小一些的棧可以儲存在伺服器的記憶體中(每個棧元素佔256個位元組). 並不保證在轉換長檔名時絕對正確無誤,準備好面對可能出現的驚奇. 預設設定: \fBmangled stack = 50\fR 示例: \fBmangled stack = 100\fR .TP mangle prefix (G) controls the number of prefix characters from the original name used when generating the mangled names\&. A larger value will give a weaker hash and therefore more name collisions\&. The minimum value is 1 and the maximum value is 6\&. mangle prefix is effective only when mangling method is hash2\&. 預設設定: \fBmangle prefix = 1\fR 示例: \fBmangle prefix = 4\fR .TP mangling char (S) 這個選項指定在name mangling操作中使用什麼樣的字元作為\fBmagic\fR字元.預設是用了'~',不過有些軟體可能會在使用上受到某些妨礙.可以設定為你想要的字元. 預設設定: \fBmangling char = ~\fR 示例: \fBmangling char = ^\fR .TP mangling method (G) controls the algorithm used for the generating the mangled names\&. Can take two different values, "hash" and "hash2"\&. "hash" is the default and is the algorithm that has been used in Samba for many years\&. "hash2" is a newer and considered a better algorithm (generates less collisions) in the names\&. However, many Win32 applications store the mangled names and so changing to the new algorithm must not be done lightly as these applications may break unless reinstalled\&. 預設設定: \fBmangling method = hash2\fR 示例: \fBmangling method = hash\fR .TP map acl inherit (S) This boolean parameter controls whether \fBsmbd\fR(8) will attempt to map the 'inherit' and 'protected' access control entry flags stored in Windows ACLs into an extended attribute called user\&.SAMBA_PAI\&. This parameter only takes effect if Samba is being run on a platform that supports extended attributes (Linux and IRIX so far) and allows the Windows 2000 ACL editor to correctly use inheritance with the Samba POSIX ACL mapping code\&. 預設設定: \fBmap acl inherit = no\fR .TP map archive (S) 這個選項決定了是否把DOS的歸檔屬性對映為UNIX可執行位.在檔案修改後DOS的歸檔位會被設定到檔案上.保持歸檔位的一個理由是使得Samba或者你的PC在新建任何檔案的時候,不會為它們設定UNIX可執行屬性。那樣對於共享原始碼、文件等等非常讓人厭煩。 注意這個選項需要在\fIcreate mask\f中沒有排除檔案屬主的執行許可權位(也就是說它必須包含100).參見\fIcreate mask\fR選項中的描述. 預設設定: \fBmap archive = yes\fR .TP map hidden (S) 這個選項決定DOS下的隱藏檔案是否要對映為UNIX全域性可執行位. 注意這個選項需要在\fIcreate mask\fR中沒有排除所有使用者的執行許可權位(也就是說它必須包含001).參見\fIcreate mask\fR選項中的描述. 預設設定: \fBmap hidden = no\fR .TP map system (S) 這個選項決定DOS下的系統檔案是否要對映為UNIX組可執行位. 注意這個選項需要在\fIcreate mask\fR中沒有排除組使用者的執行許可權位(也就是說它必須包含010).參見\fIcreate mask\fR選項中的描述. 預設設定: \fBmap system = no\fR .TP map to guest (G) 這個選項只在安全模式不是共享級(\fIsecurity=share\fR)時才有用,也就是選用了使用者安全級,伺服器安全級或者域安全級(\fBuser\fR, \fBserver\fR, 和\fBdomain\fR). 這時,選項會有三種不同的值,分別通知\fBsmbd\fR(8)在使用者以非法身份登入時作何相應處理. 這三種設定是: \fBNever\fR - 意思是使用者登入時用了個非法口令並且被伺服器所拒.這是個預設值. \fBBad User\fR - 意思是使用者登入時用了非法口令並且被伺服器所拒,除非使用者名稱不存在,否則也可以以來賓身份登入並對映到對應的\fIguest account\fB賬號. \fBBad Password\fR - 意思是使用者登入時即使用了非法口令,但是還會以來賓身份登入並對映到對應的guest賬號.可能出現這樣的問題,就是使用者雖然輸錯了口令,卻非常平靜地以\(lq來賓\(rq身份登入到系統上。他們不明白為什麼他們不能訪問那些他們認為可以訪問的資源,因為在登入時沒有任何資訊提示他們輸錯了口令。所以應該小心使用它,以避免不必要的麻煩. Helpdesk services will \fBhate\fR you if you set the \fImap to guest\fR parameter this way :-). 注意當使用共享級以外的其它安全模式時,要設定這個選項,以使"Guest"共享資源服務發揮作用.因為在這些安全級模式中,使用者請求的共享資源名在伺服器成功驗證使用者登入前\fB不會\fR傳送到伺服器作處理,所以伺服器就在不能處理聯接驗證結果時為聯接提供"Guest"共享. 對於那些以前的版本,這個選項會對映到編譯時所用的local.h檔案裡定義的\fBGUEST_SESSSETUP\fR變數的值. 預設設定: \fBmap to guest = Never\fR 示例: \fBmap to guest = Bad User\fR .TP max connections (S) 最大聯接數就是允許同時聯接到一個資源服務的最大數量限制.在\fImax connections\fR大於0的情況下,如果聯接數超過了最大聯接數設定時,超出的聯接將被拒絕.如果設為0的話就沒有這樣的聯接限制了. 為了實現這樣的功能,系統會使用記錄鎖定檔案.鎖定檔案存放在\fIlock directory\fR選項指定的目錄中. 預設設定: \fBmax connections = 0\fR 示例: \fBmax connections = 10\fR .TP max disk size (G) 控制磁碟使用的上限.如果把它設為100的話,所有的共享資源容量都不會超過100M. 注意這個選項並不是限制管理員往磁碟上存放資料的容量.在上面所說的情況中,管理員仍然可以存放超過100M的資料到磁碟上,但如果客戶查詢剩餘磁碟空間或磁碟總空間的話,所得到的結果就只在這個 \fImax disk size\fR指定的容量範圍之內. 使用這個選項主要是為了對一些瘋狂使用磁碟空間的軟體進行一定的限制,特別是它們可能會使用超過1G上以的磁碟空間. 把這個選項設為0說明沒有限制. 預設設定: \fBmax disk size = 0\fR 示例: \fBmax disk size = 1000\fR .TP max log size (G) 這個選項(一個kB為單位的整數)用來指定使用的記錄檔案最大到多少容量.samba會週期性地檢查這個容量,如果超過這個選項值就把老的檔案換名成副檔名為\fI.old\fR的檔案. 把這個選項設為0說明沒有限制. 預設設定: \fBmax log size = 5000\fR 示例: \fBmax log size = 1000\fR .TP max mux (G) 這個選項控制了對使用者允許的最大SMB併發運算元.你應該不需要設定這個選項的. 預設設定: \fBmax mux = 50\fR .TP max open files (G) 這個選項限定了在任意時間客戶端用一個 \fBsmbd\fR(8)檔案服務程序可以開啟的最大檔案數.預設的值非常高(10,000),因為對於每個未開啟的檔案只使用其中的一位. 開啟檔案極限通常用UNIX每程序最大檔案描述符數來限制更好,所以你不需要去碰這個選項的. 預設設定: \fBmax open files = 10000\fR .TP max print jobs (S) This parameter limits the maximum number of jobs allowable in a Samba printer queue at any given moment\&. If this number is exceeded, \fBsmbd\fR(8) will remote "Out of Space" to the client\&. See all \fItotal print jobs\fR\&. 預設設定: \fBmax print jobs = 1000\fR 示例: \fBmax print jobs = 5000\fR .TP max protocol (G) 此項的值是一個字串,定義了伺服器支援的最高協議等級. 可能的值是: \fBCORE\fR: 早期版本,不接受使用者名稱. \fBCOREPLUS\fR: 在CORE的基礎上改進了一些效能. \fBLANMAN1\fR: 第一個比較流行的協議,支援長檔名. \fBLANMAN2\fR: 對LANMAN1進行了更新. \fBNT1\fR: 目前用於Windows NT,一般稱為CIFS. 通常,此選項不必設定,因為在SMB協議中會自動協商並選擇合適的協議. 參見 \fImin protocol\fR 預設設定: \fBmax protocol = NT1\fR 示例: \fBmax protocol = LANMAN1\fR .TP max reported print jobs (S) This parameter limits the maximum number of jobs displayed in a port monitor for Samba printer queue at any given moment\&. If this number is exceeded, the excess jobs will not be shown\&. A value of zero means there is no limit on the number of print jobs reported\&. See all \fItotal print jobs\fR and \fImax print jobs\fR parameters\&. 預設設定: \fBmax reported print jobs = 0\fR 示例: \fBmax reported print jobs = 1000\fR .TP max smbd processes (G) This parameter limits the maximum number of \fBsmbd\fR(8) processes concurrently running on a system and is intended as a stopgap to prevent degrading service to clients in the event that the server has insufficient resources to handle more than this number of connections\&. Remember that under normal operating conditions, each user will have an \fBsmbd\fR(8) associated with him or her to handle connections to all shares from a given host\&. 預設設定: \fBmax smbd processes = 0\fR ## no limit 示例: \fBmax smbd processes = 1000\fR .TP max ttl (G) 這個選項通知\fBnmbd\fR(8) 當它用廣播或從WINS伺服器請求一個名字時,這個NetBIOS名字的有效時間('time to live', 以秒計)是多長.你不需要去碰這個選項,預設值是3天. 預設設定: \fBmax ttl = 259200\fR .TP max wins ttl (G) 這個選項通知\fBsmbd\fR(8)程式當它作為一個WINS伺服器時(\fIwins support =true\fR),nmbd承認的最長NetBIOS名字生存時間('time to live',以秒計).你不需要去改變這個選項的,預設值是6天(518400秒). 參見 \fImin wins ttl\fR 選項. 預設設定: \fBmax wins ttl = 518400\fR .TP max xmit (G) 這個選項控制透過samba的最大包容量.預設值是65535,同時這也是最大值.有時你可能用一個較小的值可以得到更好的效能.不過低於2048通常會有一些問題. 預設設定: \fBmax xmit = 65535\fR 示例: \fBmax xmit = 8192\fR .TP message command (G) 當伺服器接收到一個WinPopup類似的資訊時執行一個指定的命令. 通常這個命令所做之事都取決於你的想象. 例如: \fBmessage command = csh -c 'xedit %s;rm %s' &\fR 這個命令用\fBxedit\fR發出一條資訊,然後再刪除它.\fB注意很重要的一點是這個命令應該立即返回\fR.這就是為什麼在行末用'&'的原因.如果它沒有立即返回的話,計算機可能會在傳送資訊時當掉的(不過一般都會在30秒後恢復). 所有資訊都被以全域性訪客使用者身份傳送.命令可以使用標準的替換符,不過\fI%u\fR將不會有效(在這裡用\fI%U\fR可能更好). 除了標準替換的部分,還可以應用一些附加的替換,比如: \fI%s\fR =包含訊息的檔名 \fI%t\fR = 傳送資訊的目標(很可能是伺服器名). \fI%f\fR = 資訊的來源. 你可以用這個命令來發送郵件或者你想要的內容.如果你有關於傳送內容的好主意請通知開發人員. 有個例子可以以郵件形式傳送資訊給root: \fBmessage command = /bin/mail -s 'message from %f on %m' root < %s; rm %s\fR 如果沒有指定傳送資訊所用的命令,那麼這個資訊並不會被髮出,同時Samba向傳送者報告出錯.不幸的是WfWg(Windows for Workgrups)完全忽略出錯程式碼,提示資訊已被髮出. 如果你想要悄悄地刪掉它的話請用: \fBmessage command = rm %s\fR 預設設定: \fB沒有 message command\fR 示例: \fBmessage command = csh -c 'xedit %s; rm %s' &\fR .TP min passwd length (G) 與 \fImin password length\fR 同義. .TP min password length (G) 此項設定當執行變更UNIX口令時\fBsmbd\fR接受的明文口令的最小字元長度. 參見 \fIunix password sync\fR, \fIpasswd program\fR和 \fIpasswd chat debug\fR 選項. 預設設定: \fBmin password length = 5\fR .TP min print space (S) 此項設定一個使用者假離線列印作業必須的最小剩餘磁碟空間.當然是用kB 為單位.預設設為0,就是說使用者總是可以假離線列印作業. 參見 \fIprinting \fR 選項。 預設設定: \fBmin print space = 0\fR 示例: \fBmin print space = 2000\fR .TP min protocol (G) The value of the parameter (a string) is the lowest SMB protocol dialect than Samba will support\&. Please refer to the \fImax protocol\fR parameter for a list of valid protocol names and a brief description of each\&. You may also wish to refer to the C source code in \fIsource/smbd/negprot\&.c\fR for a listing of known protocol dialects supported by clients\&. If you are viewing this parameter as a security measure, you should also refer to the \fIlanman auth\fR 選項。 Otherwise, you should never need to change this 選項。 Default : \fBmin protocol = CORE\fR Example : \fBmin protocol = NT1\fR # disable DOS clients .TP min wins ttl (G) 此項通知\fBnmbd\fR(8)當以WINS伺服器的形式(\fIwins support = yes\fR)執行時,它所承認的NetBIOS名字的最小有效時間(以秒為單位).這個選項無需更改,預設是6小時(21600秒) 預設設定: \fBmin wins ttl = 21600\fR .TP msdfs proxy (S) This parameter indicates that the share is a stand-in for another CIFS share whose location is specified by the value of the 選項。 When clients attempt to connect to this share, they are redirected to the proxied share using the SMB-Dfs protocol\&. Only Dfs roots can act as proxy shares\&. Take a look at the \fImsdfs root\fR and \fIhost msdfs\fR options to find out how to set up a Dfs root share\&. 示例: \fBmsdfs proxy = \\\\otherserver\\someshare\fR .TP msdfs root (S) If set to \fByes\fR, Samba treats the share as a Dfs root and allows clients to browse the distributed file system tree rooted at the share directory\&. Dfs links are specified in the share directory by symbolic links of the form \fImsdfs:serverA\\\\shareA,serverB\\\\shareB\fR and so on\&. For more information on setting up a Dfs tree on Samba, refer to ???\&. 參見 \fIhost msdfs\fR 預設設定: \fBmsdfs root = no\fR .TP name cache timeout (G) Specifies the number of seconds it takes before entries in samba's hostname resolve cache time out\&. If the timeout is set to 0\&. the caching is disabled\&. 預設設定: \fBname cache timeout = 660\fR 示例: \fBname cache timeout = 0\fR .TP name resolve order (G) samba套件中的一些程式使用此項來決定使用的名字服務以及解析主機名到IP地址的次序.主要目的是控制netbios名稱怎樣解析。此選項列出不同的名字解析選項,以空格為分隔符. 這些名字解析選項是:"lmhosts","host","wins"和"bcast".它們決定了名字解析是以如下方式的: \fBlmhosts\fR : 在samba的lmhosts檔案中查詢IP地址.如果lmhosts檔案的內容行中沒有名字型別附加在NetBIOS名上時(參見\fBlmhosts\fR (5)中的詳細描述),任何型別的名字都可以匹配這個查詢. \fBhost\fR : 執行標準的主機名到IP地址的解析操作,此操作會使用系統的\fI/etc/hosts\fR,NIS或者是DNS來查詢.具體方法取決於作業系統,在IRIX和Solaris中解析名字的方法可能是由\fI/etc/nsswitch.conf\fR檔案來控制的.注意此方法只適用於對被查詢的NetBIOS名字型別為0x20(伺服器)或者是0x1c(域控制器)時才有用,其它型別都會被忽略.後一種情況只在活動目錄域中有用,返回一個匹配_ldap._tcp.domain 的SRV RR條目的DNS 查詢。 \fBwins\fR : 向列在\fIwins server\fR選項中的伺服器查詢一個名字對應的IP地址.如果沒有指定WINS伺服器,那麼此方法就被略過了. \fBbcast\fR : 向在\fIinterfaces\fR選項中列出的每一個已知本地網路介面進行廣播來作查詢.這是最不可信的名字解析方法,除非目標主機就在本地子網中. 預設設定: \fBname resolve order = lmhosts host wins bcast\fR 示例: \fBname resolve order = lmhosts bcast host\fR 在上例中首先檢查本地lmhosts檔案,然後嘗試廣播,接下來就是用通常的系統主機名查詢方式了. When Samba is functioning in ADS security mode (\fBsecurity = ads\fR) it is advised to use following settings for \fIname resolve order\fR: \fBname resolve order = wins bcast\fR DC lookups will still be done via DNS, but fallbacks to netbios names will not inundate your DNS servers with needless querys for DOMAIN<0x1c> lookups\&. .TP netbios aliases (G) 此項指定一串NetBIOS名字讓nmbd作為附加的名字進行宣佈.這樣就使一個機器在可瀏覽列表中可以出現多個名字形式.如果主機是瀏覽伺服器或登入伺服器, 就不會出現這些附加的別名,而只會使用它的初始名字. 參見 \fInetbios name\fR 選項。 預設設定: \fB空字串 (沒有附加的名字)\fR 示例: \fBnetbios aliases = TEST TEST1 TEST2\fR .TP netbios name (G) 此項對一已知的samba伺服器設定它的NetBIOS名.預設情況下會使用此主機DNS名字的主機名部分.如果這個伺服器是作瀏覽伺服器或登入伺服器時(或是主機DNS名的第一個成分時),這個伺服器名將成為這些服務對外宣佈時所用的名字. 參見 \fInetbios aliases\fR 選項 預設設定: \fBmachine DNS name\fR 示例: \fBnetbios name = MYNAME\fR .TP netbios scope (G) This sets the NetBIOS scope that Samba will operate under\&. This should not be set unless every machine on your LAN also sets this value\&. .TP nis homedir (G) 此項從NIS對映表中取得有效共享伺服器.對於用自動裝載程式的UNIX系統來說,使用者的主目錄經常根據需要從遠端伺服器裝載到一個需要的工作站上. 如果samba登入伺服器不是作為真正主目錄伺服器而是透過NFS來實現,卻通知使用者以SMB伺服器來使用主目錄時,使用者裝載主目錄來進行訪問需要兩個網路跳步(一個以SMB方式,另一個以NFS方式裝載).這樣的使用方式是非常慢的. 此選項允許當Samba在主目錄伺服器方式執行時讓samba反饋目錄伺服器而非登入伺服器上的主共享資源,這樣samba使用者可以直接從目錄伺服器上裝載目錄.當samba把目錄共享資源反饋給使用者,這時它會參考\fIhomedir map\fR選項指定的NIS對映表然後再反饋表中列出的服務. 注意要使此項起作用必須有一個運作中的NIS系統,並且samba伺服器必須是一個登入伺服器。 預設設定: \fBnis homedir = no\fR .TP nt acl support (S) 此布林量選項控制是否讓\fBsmbd\fR(8)嘗試把UNIX許可權對映到NT的訪問控制列表.這個引數在2.2.2之前是一個全域性選項。 預設設定: \fBnt acl support = yes\fR .TP ntlm auth (G) This parameter determines whether or not \fBsmbd\fR(8) will attempt to authenticate users using the NTLM encrypted password response\&. If disabled, either the lanman password hash or an NTLMv2 response will need to be sent by the client\&. If this option, and \fBlanman auth\fR are both disabled, then only NTLMv2 logins will be permited\&. Not all clients support NTLMv2, and most will require special configuration to us it\&. Default : \fBntlm auth = yes\fR .TP nt pipe support (G) 此布林量選項控制是否讓\fBsmbd\fR(8)允許Windows NT使用者聯接到NT的特殊SMB管道\fBIPC$\fR.這通常是開發者所用的除錯項,其它使用者可以不管. 預設設定: \fBnt pipe support = yes\fR .TP nt status support (G) This boolean parameter controls whether \fBsmbd\fR(8) will negotiate NT specific status support with Windows NT/2k/XP clients\&. This is a developer debugging option and should be left alone\&. If this option is set to \fBno\fR then Samba offers exactly the same DOS error codes that versions prior to Samba 2\&.2\&.3 reported\&. You should not need to ever disable this 選項。 預設設定: \fBnt status support = yes\fR .TP null passwords (G) Allow or disallow client access to accounts that have null passwords\&. 允許或禁止使用者以空口令使用賬號. 參見\fBsmbpasswd\fR(5). 預設設定: \fBnull passwords = no\fR .TP obey pam restrictions (G) When Samba 3\&.0 is configured to enable PAM support (i\&.e\&. --with-pam), this parameter will control whether or not Samba should obey PAM's account and session management directives\&. The default behavior is to use PAM for clear text authentication only and to ignore any account or session management\&. Note that Samba always ignores PAM for authentication in the case of \fIencrypt passwords = yes\fR\&. The reason is that PAM modules cannot support the challenge/response authentication mechanism needed in the presence of SMB password encryption\&. 預設設定: \fBobey pam restrictions = no\fR .TP only guest (S) 與 \fI guest only\fR同義. .TP only user (S) 此布林量選項控制是否允許當前進行聯接所用的使用者名稱沒有列在\fIuser\fR列表中.預設情況下此項是被禁止了,這樣使用者只要提供服務需要的使用者名稱就可以了.設定這個選項將強制伺服器使用\fIuser\fR列表中的登入使用者名稱,這隻在共享級安全中有效。 要注意的是上面的說法也表明了samba並不會從服務名而推演出相應的使用者名稱.這樣的話對於[homes]段就比較麻煩了.要避免麻煩的話需要用\fBuser = %S\fR,這句就表明你的使用者列表\fIuser\fR正好就是這個服務資源名,這時的主目錄名就是使用者名稱. 參見 \fIuser\fR 選項。 預設設定: \fBonly user = no\fR .TP oplock break wait time (G) 此項調整性的選項以適應在Windows 9x和WinNT中可能出現的錯誤.當用戶發起一個會導致oplock暫停請求(oplock break request)的SMB對話時,如果samba對其響應太快的話,客戶端將會失敗並且不能響應此請求.這個可調整的選項(以毫秒為單位)是一個samba在向這樣的客戶傳送oplock暫停請求前等待的時間量. \fB除非你理解了samba的oplock程式碼,否則不要改變這個選項!\fR 預設設定: \fBoplock break wait time = 0\fR .TP oplock contention limit (S) 這是個\fB非常\fR高階的\fBsmbd\fR(8)調整選項,用以改進在多個使用者爭奪相同檔案時oplocks認可操作的效率. 簡單地說,這個選項指定了一個數字,如果爭奪相同檔案的使用者數量超過了此設定極限的話,即使有請求,\fBsmbd\fR(8)也不再認可oplock的操作了.這樣的話\fBsmbd\fR就象Windows NT一樣的執行. \fB除非你理解了samba的oplock程式碼,否則不要改變這個選項! \fR 預設設定: \fBoplock contention limit = 2\fR .TP oplocks (S) 此布林量通知\fBsmbd\fR是否對當前請求的共享資源上的檔案開啟操作啟用oplocks(機會性的鎖定操作).oplock程式碼可以明顯改善訪問samba伺服器檔案的速度(approx.30% 甚至更多).它允許本地快取檔案,對於不可信賴的網路環境來說可能需要禁止掉這個選項(在Windows NT伺服器上它是預設開啟的).請參考samba \fIdocs/\fR目錄下的\fISpeed.txt\fR檔案. oplocks會有選擇性地關閉每一個基本共享資源上的特定檔案.參見\fI veto oplock files\fR 選項.在有些系統上會透過最底層的作業系統確認oplocks.這樣就可以在所有的訪問與oplocked檔案中進行資料同步,而不管此訪問是透過samba或NFS或者是本地的UNIX程序.參見\fIkernel oplocks\fR選項檢視細節. 參見 \fIkernel oplocks\fR 以及 \fI level2 oplocks\fR parameters. 預設設定: \fBoplocks = yes\fR .TP os2 driver map (G) The parameter is used to define the absolute path to a file containing a mapping of Windows NT printer driver names to OS/2 printer driver names\&. The format is: = \&. For example, a valid entry using the HP LaserJet 5 printer driver would appear as \fBHP LaserJet 5L = LASERJET.HP LaserJet 5L\fR\&. The need for the file is due to the printer driver namespace problem described in ???\&. For more details on OS/2 clients, please refer to ???\&. 預設設定: \fBos2 driver map = <空字串>\fR .TP os level (G) 這個整數值控制在瀏覽器選舉中Samba宣佈它本身是什麼系統級別. 此選項的值決定了\fBnmbd\fR(8是否有機會成為本地廣播區域內工作組\fI WORKGROUP\fR中的主控瀏覽器. \fB注意\fR: 預設情況下,Samba將在本地主控瀏覽器選舉中超越所有M$作業系統並且獲勝,除非還有Windows NT4.0/2000 域控制器。這意味著Samba主機的錯誤配置將使一個子網的瀏覽無效。參見Samba \fIdocs/\fR 目錄中的\fIBROWSING.txt \fR來獲取詳細資訊。 預設設定: \fBos level = 20\fR 示例: \fBos level = 65 \fR .TP pam password change (G) With the addition of better PAM support in Samba 2\&.2, this parameter, it is possible to use PAM's password change control flag for Samba\&. If enabled, then PAM will be used for password changes when requested by an SMB client instead of the program listed in \fIpasswd program\fR\&. It should be possible to enable this without changing your \fIpasswd chat\fR parameter for most setups\&. 預設設定: \fBpam password change = no\fR .TP panic action (G) 此項是一個samba開發者使用的選項以允許當\fBsmbd\fR(8)或\fBsmbd\fR(8)程式崩潰時可以呼叫一個系統命令.通常這種功能被用於發出對問題的警告. 預設設定: \fBpanic action = <空字串>\fR 示例: \fBpanic action = "/bin/sleep 90000"\fR .TP paranoid server security (G) Some version of NT 4\&.x allow non-guest users with a bad passowrd\&. When this option is enabled, samba will not use a broken NT 4\&.x server as password server, but instead complain to the logs and exit\&. Disabling this option prevents Samba from making this check, which involves deliberatly attempting a bad logon to the remote server\&. 預設設定: \fBparanoid server security = yes\fR .TP passdb backend (G) This option allows the administrator to chose which backends to retrieve and store passwords with\&. This allows (for example) both smbpasswd and tdbsam to be used without a recompile\&. Multiple backends can be specified, separated by spaces\&. The backends will be searched in the order they are specified\&. New users are always added to the first backend specified\&. This parameter is in two parts, the backend's name, and a 'location' string that has meaning only to that particular backed\&. These are separated by a : character\&. Available backends can include: .TP 3 \(bu \fBsmbpasswd\fR - The default smbpasswd backend\&. Takes a path to the smbpasswd file as an optional argument\&. .TP \(bu \fBtdbsam\fR - The TDB based password storage backend\&. Takes a path to the TDB as an optional argument (defaults to passdb\&.tdb in the \fIprivate dir\fR directory\&. .TP \(bu \fBldapsam\fR - The LDAP based passdb backend\&. Takes an LDAP URL as an optional argument (defaults to \fBldap://localhost\fR) LDAP connections should be secured where possible\&. This may be done using either Start-TLS (see \fIldap ssl\fR) or by specifying \fIldaps://\fR in the URL argument\&. .TP \(bu \fBnisplussam\fR - The NIS+ based passdb backend\&. Takes name NIS domain as an optional argument\&. Only works with sun NIS+ servers\&. .TP \(bu \fBmysql\fR - The MySQL based passdb backend\&. Takes an identifier as argument\&. Read the Samba HOWTO Collection for configuration details\&. .LP 預設設定: \fBpassdb backend = smbpasswd\fR 示例: \fBpassdb backend = tdbsam:/etc/samba/private/passdb.tdb smbpasswd:/etc/samba/smbpasswd\fR 示例: \fBpassdb backend = ldapsam:ldaps://ldap.example.com\fR 示例: \fBpassdb backend = mysql:my_plugin_args tdbsam\fR .TP passwd chat (G) 這個字串控制在\fBsmbd\fR(8)和本地口令更改程式間更使用者口令時發生的\fB"chat"\fR對話.字串描述一個應答接收對的序列,讓\fBsmbd\fR(8)用於決定對\fIpasswd program\fR傳送並等待接收哪些具體的內容.如果沒有收到預計的輸出時不會更改口令. 這個chat序列一般發生在特定的主機上,取決於本地口令控制的方法(就象NIS或者別的). 注意這個選項僅僅在\fIunix password sync\fR選項設定為\fByes\fR的時候有用。當smbpasswd檔案中的SMB口令被更改時是\fB以root身份\fR執行的,不必輸入舊密碼文字. 這意味著root必須可以在不知道使用者密碼時重置他的密碼。在NIS/YP 中這意味著passwd程式必須在NIS主控伺服器上執行。 這個字串可以包含\fI%n\fR宏,用於替換新密碼。chat序列還可以包含標準宏\fB\\\\n\fR, \fB\\\\r\fR, \fB\\\\t\fR 和\fB\\\\s\fR 來給出換行,回車,tab和空格。chat序列字串還可以包含'*' 來匹配任何字元序列。雙引號用來將帶空格的字串設為一個單獨的字串。 如果在對話序列的任何部分發送的字串為一個句號".",那麼不會發送任何內容.同樣,如果等待接收部分有字串是一個".",那麼不等待任何的內容. 如果\fIpam password change\fR引數設定為\fByes\fR,chat可以以任何順序進行,沒有特定的輸出,是否成功可以由PAM結果得到。在PAM會話中宏\\n被忽略。 參見 \fIunix password sync\fR, \fI passwd program\fR , \fIpasswd chat debug\fR 和 \fIpam password change\fR. 預設設定: \fBpasswd chat = *new*password* %n\\n *new*password* %n\\n *changed*\fR 示例: \fBpasswd chat = "*Enter OLD password*" %o\\n "*Enter NEW password*" %n\\n "*Reenter NEW password*" %n\\n "*Password changed*"\fR .TP passwd chat debug (G) 此布林量指定口令對話指令碼選項是否以 \fBdebug\fR模式執行.在除錯模式下,傳送和接收的口令對話字串會列印到\fIdebug level\fR為100時的\fBsmbd\fR(8)記錄檔案中.由於在\fBsmbd\fR 記錄中允許使用明文口令,所以這是個危險的選項.不過這個選項可以幫助Samba管理員在呼叫\fIpasswd program\fR設好的口令程式時除錯其\fIpasswd chat\fR 對話指令碼,並且應該在完成以後把它關閉.這個選項在設定了\fIpam password change\fR選項時無效。預設情況下這個選項是關閉的. 參見 \fIpasswd chat\fR , \fIpam password change\fR , \fIpasswd program\fR . 預設設定: \fBpasswd chat debug = no\fR .TP passwd program (G) 指定用於設定UNIX使用者口令的程式名.出現\fI%u\fR的地方表示以使用者名稱替換.在呼叫口令更改程式前會先檢查使用者名稱是否存在. 需要注意的是很多口令程式強調口令要\fB合法\fR,例如應該有最小長度或者是字母與數字的混合.這可能在一些客戶端(如WfWg)總將口令轉為大寫傳送時,引起一些問題. \fB注意\fR如果把\fIunix password sync\fR選項設為\fByes\fR的話,在改變smbpasswd檔案中的SMB口令時是\fB以root身份\fR呼叫改口令程式的.如果口令更改失敗的話,\fBsmbd\fR對SMB口令的更改也會失敗,這是設計時的機制. 如果設定了\fIunix password sync\fR選項的話,指定口令程式時\fB必須使用\fB所有\fR程式的絕對路徑,必須檢查安全問題.預設的\fIunix password sync\fR選項值是 \fBno\fR. 參見 \fIunix password sync\fR. 預設設定: \fBpasswd program = /bin/passwd\fR 示例: \fBpasswd program = /sbin/npasswd %u\fR .TP password level (G) 在一些客戶端/伺服器群體中使用大小寫混合口令存在著困難.其中比較麻煩的一類客戶是WfWg,因為它在使用LANMAN1協議時出於某些理由而強調要使用大寫口令.不過當使用COREPLUS時不要修改它! 另外在Windows95/98 作業系統中會出問題: 即使選擇了會話中的NTLM0.12協議,這些客戶端也會將明文口令轉為大寫。 此選項定義了口令字中大寫字母的最大數量. 例如,假定給出的口令是"FRED".如果\fI password level\fR設為1的話,在"FRED"驗證失敗時會嘗試以下的口令組合: "Fred", "fred", "fRed", "frEd","freD" 如果\fIpassword level\fR設為2的話,就會嘗試下面的組合: "FRed", "FrEd", "FreD", "fREd", "fReD", "frED", \&.\&. 等等。 把此選項設成的值越高,相對單一大小寫口令來說大小寫混合的口令越容易匹配。.不過,要小心使用這個選項會降低安全性,同時增加處理新聯接所花的時間量. 如果把選項設為0時會使處理口令時只作兩種嘗試 - 先與給出的口令比較,再比較它的全部小寫形式. 預設設定: \fBpassword level = 0\fR 示例: \fBpassword level = 4\fR .TP password server (G) 透過在這裡指定其它的SMB伺服器或者活動目錄域控制器,同時使用\fBsecurity = [ads|domain|server]\fR,能把聯接samba的使用者名稱/口令合法性驗證交給指定的遠端伺服器去幹. 此選項設定上面所說的其它口令伺服器的名字或者IP地址. 新的語法允許在連線到ADS realm伺服器時指定埠號。要指定預設的LDAP 389埠之外的號碼,可以將埠號放在名字或ip後面,中間用一個冒號連線(比如說,192.168.1.100:389)。如果你不指定一個埠,Samba將使用標準的LDAP埠tcp/389. 注意埠號在WindowsNT4.0 域或者netbios連線的伺服器上無效 如果引數是一個名稱,它將使用 \fIname resolve order\fR 中指定的方式來解析。 口令伺服器應該是使用"LM1.2X002"或"LM NT 0.12"協議的主機,而且它本身必須使用使用者級安全模式. 注意:使用口令伺服器表明你的UNIX主機(就是執行Samba的那臺)就只與你指定的口令伺服器具有相同的安全等級了.\fB在沒有完全信任的情況下不要選擇使用其它的口令伺服器\fR. 不要把口令服務指向Samba伺服器本身,這產生一個迴圈而去查詢你的Samba伺服器,導致死鎖. 在指定口令伺服器名時可以使用標準的替換符,而實際能用的可能只是\fI%m\fR這一個,這個替換符說明Samba伺服器會用聯入的客戶作為口令伺服器.如果這樣用的話說明你非常信任你的客戶,同時最好以主機允許策略對他們進行限制! 如果把安全級\fIsecurity\fR選項設為\fBdomain\fR或者\fBads\fR的話,指定的其它口令伺服器必須是在這個Domain中的一個主域控制器或備份域控制器或者'*'.另外指定字元'*'的話就以samba伺服器會在整個域中使用加密驗證RPC呼叫來驗證使用者登入.使用\fB security = domain\fR的好處是,如果指定了幾個\fIpassword server\fR時,\fBsmbd \fR會對每一個進行嘗試直到它收到回應,對於初始伺服器當機時這就很有用了. 如果\fIpassword server\fR選項設為字元'*'的話,samba將嘗試透過查詢\fBWORKGROUP<1C>\fR名字來自動查詢主或者備份域控制器並聯系經過名字解析得到的IP地址列表中的每個伺服器來進行使用者驗證. 如果伺服器列表包含名字或IP同時也包含'*'時,列表將視為首選域控制器的列表,但是也會新增一個自動的對所有其餘DC的查詢。Samba不會透過定位最近的DC來最佳化這張列表。 如果\fIsecurity\fR是\fBserver\fR的話,會有一些安全級為\fBsecurity = domain\fR時所沒有的限制: 如果在\fIpassword server\fR選項中指定了幾個口令伺服器的話,\fBsmbd\fR在聯接具體的伺服器時會失敗,也不能驗證任何的使用者賬號.這是安全級為\fBsecurity = server \fR模式時SMB/CIFS協議的一個限制,並且Samba無法修改. 如果把Windows NT伺服器作為口令伺服器,你必須確保使用者可以從Samba伺服器上進行登入.當使用\fB security = server\fR模式時,網路登入看起來是從那裡處理的,而不是從使用者工作站. 參見 \fIsecurity \fR 選項。 預設設定: \fBpassword server = <空字串>\fR 示例: \fBpassword server = NT-PDC, NT-BDC1, NT-BDC2, *\fR 示例: \fBpassword server = windc.mydomain.com:389 192.168.1.101 *\fR 示例: \fBpassword server = *\fR .TP path (S) 此項指定給出的服務項所用的系統路徑.在服務項具有可列印屬性時,列印假離線資料會先存放在這個路徑所指的位置中. This parameter specifies a directory to which the user of the service is to be given access\&. In the case of printable services, this is where print data will spool prior to being submitted to the host for printing\&. 對於那些要對訪客提供的可列印服務來說,服務項應該設為只讀,而且路徑應該設為全域性可寫屬性並具有粘性(s)位.這當然不是強制性的,不過不這樣做的話可能會無法得到你所希望的結果. 路徑出現\fI%u\fR的地方將以正處於聯接狀態的UNIX使用者名稱來替換;同樣出現\fI%m\fR的地方將以請求聯接的主機NetBIOS名替換.在設定偽主目錄時,這種替換項很有用的. 所指定的路徑都是基於根目錄\fIroot dir\fR(如果有的話)的. 預設設定: \fB無\fR 示例: \fBpath = /home/fred\fR .TP pid directory (G) This option specifies the directory where pid files will be placed\&. 預設設定: \fBpid directory = ${prefix}/var/locks\fR 示例: \fBpid directory = /var/run/\fR .TP posix locking (S) The \fBsmbd\fR(8) daemon maintains an database of file locks obtained by SMB clients\&. The default behavior is to map this internal database to POSIX locks\&. This means that file locks obtained by SMB clients are consistent with those seen by POSIX compliant applications accessing the files via a non-SMB method (e\&.g\&. NFS or local file access)\&. You should never need to disable this 選項。 預設設定: \fBposix locking = yes\fR .TP postexec (S) 此項指定在斷開服務時執行的一個命令.它使用通常的替換項.此命令在一些系統中可能是以root身份來執行的. 一個有趣的示例,用於解除安裝伺服器資源: \fBpostexec = /etc/umount /cdrom\fR 參見 \fIpreexec\fR. 預設設定: \fB無 (不執行命令)\fR 示例: \fBpostexec = echo \"%u disconnected from %S from %m (%I)\" >> /tmp/log\fR .TP preexec (S) 此項指定在聯接到服務時執行一個命令.通常這也可以用一些替換項. 一個有趣的示例,在使用者每一次登入時向對方傳送一個歡迎資訊:(一條格言?) \fBpreexec = csh -c 'echo \"Welcome to %S!\" | /usr/local/samba/bin/smbclient -M %m -I %I' & \fR 當然,一段時間以後這類資訊可能就比較討厭了:-) 參見 \fIpreexec close\fR 和 \fIpostexec \fR. 預設設定: \fB無 (不執行命令)\fR 示例: \fBpreexec = echo \"%u connected to %S from %m (%I)\" >> /tmp/log\fR .TP preexec close (S) 此布林量選項控制是否從\fIpreexec \fR返回的非零程式碼會關閉所聯接的服務. 預設設定: \fBpreexec close = no\fR .TP prefered master (G) 這是為拼寫錯誤準備的。請檢視 \fI preferred master\fR :-) .TP preferred master (G) 此布林量選項控制\fBnmbd\fR(8)是否作為工作組裡的首選主瀏覽器. 如果設此選項為\fByes\fR時,\fBnmbd\fR會在啟動時強制進行一次選舉,它有一些有利條件來贏得選舉.推薦把此選項與\fB domain master = yes\fR聯合使用,這樣\fBnmbd\fR可以保證成為一個域瀏覽器. 小心使用此項,因為如果在相同的子網內有多個主機(不管是Samba伺服器,Windows95還是NT)參加選舉的話,他們每個都會週期性不斷地嘗試成為本地主瀏覽器,這時會造成不必須的廣播交通流量並降低瀏覽效能. 參見 \fIos level\fR. 預設設定: \fBpreferred master = auto\fR .TP preload (G) 此選項定義了要自動加入到瀏覽列表的服務項清單.這對於homes和printers服務項非常有用,否則這些服務將是不可見的. 注意,如果你想載入printcap裡所有的印表機,那麼用\fIload printers\fR會更容易. 預設設定: \fBno preloaded services\fR 示例: \fBpreload = fred lp colorlp\fR .TP preload modules (G) This is a list of paths to modules that should be loaded into smbd before a client connects. This improves the speed of smbd when reacting to new connections somewhat\&. 預設設定: \fBpreload modules = \fR 示例: \fBpreload modules = /usr/lib/samba/passdb/mysql.so+++ \fR .TP preserve case (S) 此項控制建立新的檔案時取名是否使用使用者傳遞的大小寫,還是強制使用\fIdefault case \fR. 預設設定: \fBpreserve case = yes\fR 參見NAME MANGLING段中的完整討論. .TP printable (S) 如果此項設為\fByes\fR,那麼使用者可以讀寫併發送列印快取檔案到服務項指定的目錄中. 注意一個可列印的服務\fB總是\fR允許透過快取列印資料的方法向服務項路徑中執行寫操作(需要使用者有可寫許可權).\fIread only\fR選項控制只允許不可列印地訪問資源. 預設設定: \fBprintable = no\fR .TP printcap (G) 與 \fI printcap name\fR 同義. .TP printcap name (S) 此項用於覆蓋掉編譯時產生的預設printcap名(通常是\fI/etc/printcap\fR).參見[printers]段的討論,它說明了為什麼要這樣做的理由. To use the CUPS printing interface set \fBprintcap name = cups \fR\&. This should be supplemented by an addtional setting printing = cups in the [global] section\&. \fBprintcap name = cups\fR will use the "dummy" printcap created by CUPS, as specified in your CUPS configuration file\&. 在可以用\fBlpstat\fR命令列出可用印表機的列表的System V系統上,可以用\fBprintcap name = lpstat \fR來自動獲得可用印表機列表.這對於配置samba時定義成SYSV的系統(這就包括了很多基於System V的系統)來說是預設情況.如果在這些系統上設好\fIprintcap name\fR為\fIlpstat\fR的話,samba就會執行\fBlpstat -v\fR並嘗試分析輸出資訊以獲得一份印表機列表. 通常最小的printcap檔案看起來就象下面這樣: .nf print1|My Printer 1 print2|My Printer 2 print3|My Printer 3 print4|My Printer 4 print5|My Printer 5 .fi 我們看到'|'符號用來定義印表機的別名.第二個帶有空格的別名其實是提示Samba它是註釋. 在AIX中預設的printcap檔名是\fI/etc/qconfig\fR. 如果在檔名中找到\fIqconfig\fR字樣,Samba將假定檔案是AIX 的\fIqconfig\fR格式。 預設設定: \fBprintcap name = /etc/printcap\fR 示例: \fBprintcap name = /etc/myprintcap\fR .TP print command (S) 當一個列印作業完全緩衝到了服務項時,此項指定的命令就能過呼叫\fBsystem()\fR來處理那些快取檔案.通常我們指定典型的命令來發送快取檔案到主機的列印子系統,不過也不一定要這樣.伺服器不會刪除那些快取檔案,所以你指定的任何命令都應當在處理完以後刪除檔案,否則的話就需要手工來刪除舊的快取檔案了. 列印命令是一個簡單的文字字串。它可以在宏替換之後逐字傳遞給系統。 %s, %f - 緩衝檔名路徑 %p - 適當的印表機名 %J - 客戶提交的作業名 %c - 緩衝的作業需要列印的頁數 %z -緩衝的列印作業的大小(以位元組計) 列印命令至少\fB必須\fR包含\fI%s\fR或\fI%f\fR替換符中的一個,而\fI%p\fR是個可選項.在提交列印作業時,如果不提供印表機名的話,\fI%p\fR替換符會從列印命令中刪掉. 如果在[global]段中指定了列印命令,它將被用於任何可列印性的服務項,而不再需要在它們之中單獨指定了. 如果既沒有對可列印性服務項單獨指定列印命令又沒有指定一個全域性的列印命令時,假離線檔案雖然會建立卻不會被處理也不會被刪除(這很重要哦). 注意在某些UNIX上以\fBnobody\fR賬號身份進行列印會導致失敗.如果發生了這樣的情況請建立一個單獨的有列印權的訪客賬號並在[global]段裡設定\fIguest account\fR選項. 如果你明白命令是直接傳遞給shell的話,你可以組織非常複雜的列印命令.舉例來說,下面的命令會記錄一個列印作業,列印這個檔案然後刪掉它.注意這裡的';'是shell指令碼命令常用的分隔符. \fBprint command = echo Printing %s >> /tmp/print.log; lpr -P %p %s; rm %s\fR 你可能必須根據平時在系統上列印檔案的方式來改變這個命令.預設情況下,此選項會根據\fIprinting\fR選項的設定而變化. 預設設定: 對於 \fBprinting = BSD, AIX, QNX, LPRNG 或者 PLP :\fR \fBprint command = lpr -r -P%p %s\fR 對於 \fBprinting = SYSV 或者 HPUX :\fR \fBprint command = lp -c -d%p %s; rm %s\fR 對於 \fBprinting = SOFTQ :\fR \fBprint command = lp -d%p -s %s; rm %s\fR 對於 \fBprinting = CUPS :\fR 如果Samba 編譯時加入了libcups, 那麼\fIprintcap=cups\fR將使用CUPS API來提交作業等等。否則它用-oraw選項,使用SystemV命令來列印,也就是說它會用\fBlp -c -d%p -o raw; rm %s\fR.當\fBprinting = cups\fR, 並且Samba編譯時加入了libcups時,任何手工設定的列印命令將被忽略。 示例: \fBprint command = /usr/local/samba/bin/myprintscript %p %s\fR .TP printer (S) 與 \fI printer name\fR 同義。 .TP printer admin (S) This is a list of users that can do anything to printers via the remote administration interfaces offered by MS-RPC (usually using a NT workstation)\&. Note that the root user always has admin rights\&. 預設設定: \fBprinter admin = <空字串>\fR 示例: \fBprinter admin = admin, @staff\fR .TP printer name (S) 此選項指定可列印性服務項用來列印快取作業資料的印表機. 如果在[global]段裡指定了印表機名稱,那麼給出的印表機就用於任何可列印性服務項而不需個別的指定印表機名稱了. 預設設定: \fB空 (在很多系統中可能是 \fBlp\fR )\fR 示例: \fBprinter name = laserwriter\fR .TP printing (S) 此選項控制系統上如何解釋印表機狀態資訊,而如果在[global]段中定義,它也會影響\fIprint command\fR,\fIlpq command\fR,\fIlppause command\fR,\fIlpresume command\fR和\fIlprm command\fR這些選項的預設值 通常系統支援九種印表機風格,它們是\fBBSD\fR, \fBAIX\fR, \fBLPRNG\fR, \fBPLP\fR, \fBSYSV\fR, \fBHPUX\fR, \fBQNX\fR, \fBSOFTQ\fR,還有 \fBCUPS\fR 要在系統上檢視使用了不同的選項後其它列印命令的預設值,可以用\fBtestparm\fR(1)程式. 此項可以在每一臺印表機上分別設定. 參見[printers]段的討論。 .TP print ok (S) 與 \fIprintable\fR 同義。 .TP private dir (G) This parameters defines the directory smbd will use for storing such files as \fIsmbpasswd\fR and \fIsecrets\&.tdb\fR\&. Default :\fBprivate dir = ${prefix}/private\fR .TP profile acls (S) This boolean parameter controls whether \fBsmbd\fR(8) This boolean parameter was added to fix the problems that people have been having with storing user profiles on Samba shares from Windows 2000 or Windows XP clients\&. New versions of Windows 2000 or Windows XP service packs do security ACL checking on the owner and ability to write of the profile directory stored on a local workstation when copied from a Samba share\&. When not in domain mode with winbindd then the security info copied onto the local workstation has no meaning to the logged in user (SID) on that workstation so the profile storing fails\&. Adding this parameter onto a share used for profile storage changes two things about the returned Windows ACL\&. Firstly it changes the owner and group owner of all reported files and directories to be BUILTIN\\\\Administrators, BUILTIN\\\\Users respectively (SIDs S-1-5-32-544, S-1-5-32-545)\&. Secondly it adds an ACE entry of "Full Control" to the SID BUILTIN\\\\Users to every returned ACL\&. This will allow any Windows 2000 or XP workstation user to access the profile\&. Note that if you have multiple users logging on to a workstation then in order to prevent them from being able to access each others profiles you must remove the "Bypass traverse checking" advanced user right\&. This will prevent access to other users profile directories as the top level profile directory (named after the user) is created by the workstation profile code and has an ACL restricting entry to the directory tree to the owning user\&. 預設設定: \fBprofile acls = no\fR .TP protocol (G) 與 \fImax protocol\fR 同義 .TP public (S) 與 \fIguest ok\fR 同義 .TP queuepause command (S) 定義伺服器暫停列印佇列時要執行的命令. 此命令應該是個只用印表機名作為選項的程式或指令碼,以便用來停止列印佇列,使列印作業不再向列印機發送. 此命令不支援Windows for Workgroups,但可以在Windows 95和NT的印表機視窗中傳送. 此處用替換符\fI%p\fR可以替代印表機名稱.否則這個名稱將被放置在命令後面. 注意,在命令中使用絕對路徑是個好習慣,因為不一定可以獲得伺服器的PATH變數. 預設設定: \fB依賴於 \fIprinting\fR 選項的設定\fR 示例: \fBqueuepause command = disable %p\fR .TP queueresume command (S) 定義伺服器恢復暫停了的列印佇列時要執行的命令.就是用於恢復因為上面的選項(\fI queuepause command\fR)而導致的結果的. 此命令應該是個只用印表機名作為選項的程式或指令碼,以便用來恢復列印佇列,使列印作業繼續向列印機發送. 此命令不支援Windows for Workgroups,但可以在Windows 95和NT的印表機視窗中傳送. 此處用替換符\fI%p\fR可以替代印表機名稱.否則這個名稱將被放置在命令後面. 注意,在命令中使用絕對路徑是個好習慣,因為不一定可以獲得伺服器的PATH變數. 預設設定: \fB依賴於 \fIprinting\fR 選項的設定\fR 示例: \fBqueuepause command = enable %p\fR .TP read bmpx (G) 此布林量選項控制是否讓\fBsmbd\fR(8)支援"多工讀塊"(Read Block Multiplex)的SMB.現在這種方式已經很少用了,所以預設是\fBno\fR.一般你不需要設定此選項. 預設設定: \fBread bmpx = no\fR .TP read list (S) 此處給出對服務項有隻讀許可權的使用者清單.如果正在聯接的使用者屬於此列表,那麼他們將沒有寫許可權,此時是不管\fIread only\fR選項是否設定的.此列表可以包括用在\fI invalid users\fR 選項中描述的語法定義的組名稱. 參見 \fI write list\fR 和 \fIinvalid users\fR 選項。 預設設定: \fBread list = <空字串>\fR 示例: \fBread list = mary, @students\fR .TP read only (S) 注意它與 \fIwriteable\fR 反義. 如果這個引數是\fByes\fR, 那麼服務的使用者不能建立或修改服務目錄中的檔案。 注意一個可列印的服務(\fBprintable = yes\fR) 的目錄\fB 總是\fR 可寫的(需要使用者可寫許可權)但是隻能透過緩衝操作來寫. 預設設定: \fBread only = yes\fR .TP read raw (G) 此選項控制著是否讓伺服器在傳送資料到客戶端時支援讀取原始的SMB請求. 如果允許,那麼它會以65535 位元組為單位來讀取一個數據包的65535位元組.這會帶來較多的效能方面的好處. 但是,有些客戶端使用不正確的包容量(雖然是可允許的),或者它們不支援大容量包,所以對這些客戶端你應該禁止這一選項. 通常將此選項作為一種系統除錯工具,而且嚴格來說不應修改.參見\fIwrite raw\fR選項. 預設設定: \fBread raw = yes\fR .TP read size (G) 此項影響著磁碟讀/寫與網路讀/寫的輪流交替.如果在若干個SMB命令(通常是SMBwrite,SMBwriteX和SMBreadbraw)中傳送的資料量超過此項設定的值時,伺服器開始就會在從網路接收整個資料包之前進行寫操作;在執行SMBreadbraw的情況下,伺服器在從磁碟上讀出所有資料之前就開始向網路中寫資料. 在磁碟與網路的訪問速度相近時,這種交迭式的工作就會做得非常好,不過當其中一類裝置的速度大大高於另一類時,它只會有那麼一點點效果. 預設的值是16384,但沒有做過測試最優值的實驗。根據已經瞭解的情況來看,在使用不同的系統時,最最佳化值的差別很大.一個大於65536的值是沒有任何意義的,它只會造成不必要的記憶體分配. 預設設定: \fBread size = 16384\fR 示例: \fBread size = 8192\fR .TP realm (G) This option specifies the kerberos realm to use\&. The realm is used as the ADS equivalent of the NT4 \fBdomain\fR\&. It is usually set to the DNS name of the kerberos server\&. 預設設定: \fBrealm = \fR 示例: \fBrealm = mysambabox.mycompany.com\fR .TP remote announce (G) 此項允許你設定\fBnmbd\fR(8)週期性地向任意工作組的任意IP地址申明自己的存在. 如果你要samba伺服器處在一個通常瀏覽傳播規則沒有正常工作的遠端工作組裡時,用此項就很有用了.此遠端工作組可以位於IP包到得到的任何地方. 例如: \fBremote announce = 192.168.2.255/SERVERS 192.168.4.255/STAFF\fR 以上這行說明\fBnmbd\fR 對兩個給出的使用工作組名的IP地址進行申明.如果你只用了IP地址的話,那麼會用\fIworkgroup\fR選項裡給出的工作組名來替代. 你選用的IP地址通常應該是遠端網路的廣播地址,不過也可以用配置穩定的網路中的已知主瀏覽器IP地址. 預設設定: \fBremote announce = <空字串>\fR .TP remote browse sync (G) 此項允許你設定\fBnmbd\fR(8)週期性地同步位於遠端(remote segment)的Samba主瀏覽器上的瀏覽列表.同時也允許你收集位於具有交叉路由子網中主瀏覽器上的瀏覽列表.這是以一種和其他非Samba的伺服器不相容的方式進行的。 This is useful if you want your Samba server and all local clients to appear in a remote workgroup for which the normal browse propagation rules don't work\&. The remote workgroup can be anywhere that you can send IP packets to. 例如: \fBremote browse sync = 192.168.2.255 192.168.4.255\fR 以上行會使\fBnmbd\fR向位於指定子網或地址中的主瀏覽器請求同步他們本地伺服器中的瀏覽列表 你選用的IP地址通常應該是遠端網路的廣播地址,不過也可以用配置非常穩定的網路中的已知主瀏覽器IP地址.如果給出一個主機的IP地址,或者主控瀏覽器事實上在自己的網段中, samba就\fB不\fR驗證遠端主機是否有效、是否正在偵聽了。 預設設定: \fBremote browse sync = <空字串>\fR .TP restrict anonymous (G) 這個選項限制了是否在匿名連線中返回使用者和組列表資訊,仿照了Windows2000 和NT在登錄檔鍵值\fBHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\LSA\\RestrictAnonymous\fR 中的做法。設定為0的時候,任何請求都返回使用者和組列表。設定為1的時候,只有認證的使用者可以獲得使用者和組列表。設定為2的時候,只有Windows2000/XP和Samba支援,不允許匿名連線。這樣做會阻止需要匿名操作的M$或第三方程式執行。 The security advantage of using restrict anonymous = 1 is dubious, as user and group list information can be obtained using other means. The security advantage of using restrict anonymous = 2 is removed by setting \fIguest ok\fR = yes on any share. 預設設定: \fBrestrict anonymous = 0\fR .TP root (G) 與 \fIroot directory"\fR 同義 .TP root dir (G) 與 \fIroot directory"\fR 同義. .TP root directory (G) 伺服器將在啟動時對此項所設之目錄進行\fBchroot()\fR(也就是改變根目錄) 操作.對於安全操作來說,這並不是十分必要的.如果沒有這步操作,伺服器會拒絕對服務項以外的檔案進行訪問.同時也檢查並拒絕那些檔案系統其它部分的軟連結或者嘗試在其它目錄(取決於選項\fIwide links\fR的設定情況)中使用".."這些操作. 加入一個\fIroot directory\fR,注意不是實際的"/"目錄,可以增加額外的安全級別,但是代價就高了.這樣完全確保了所指定的\fIroot directory\fR及所屬子目錄外的檔案都是不能訪問的,\fB包括\fR伺服器正常執行時所需的一些檔案也是如此.因此要想維護伺服器整體的可操作性,你需要映象一些系統檔案到所指定的\fIroot directory\fR下.特別是要映象 \fI/etc/passwd\fR檔案或此檔案的子集,如果需要的話,任何列印操作要用到的二進位制檔案或配置檔案也要映象.當然,應該由作業系統決定必須被映象的檔案集合. 預設設定: \fBroot directory = /\fR 示例: \fBroot directory = /homes/smb\fR .TP root postexec (S) 此項與 \fIpostexec\fR選項含義相同,只是以root身份來執行命令而已.在一次聯接關閉之後對檔案系統,特別是光碟驅動器進行解除安裝是非常有用的. 參見 \fI postexec\fR. 預設設定: \fBroot postexec = <空字串>\fR .TP root preexec (S) 此項與 \fIpreexec\fR選項含義相同,只是以root身份來執行命令而已.在一次聯接穩定建立之後裝載檔案系統,特別是光碟驅動器是非常有用的. 參見 \fI preexec\fR 和 \fIpreexec close\fR 選項. 預設設定: \fBroot preexec = <空字串>\fR .TP root preexec close (S) 此項與\fIpreexec close \fR選項含義相同,只是以root身份來執行命令而已. 參見 \fI preexec\fR 和\fIpreexec close\fR. 預設設定: \fBroot preexec close = no\fR .TP security (G) 此項是\fIsmb.conf\fR檔案中最重要的一個設定之一,它影響了客戶是如何應答Samba伺服器的. 這個選項設定了\(lq安全模式位\(rq用於答覆協議協商以使\fBsmbd\fR(8) 調整共享安全級是開或者關.客戶端根據此位決定是否(以及如何)向伺服器傳送使用者和口令資訊. 預設值是\fBsecurity = user\fR,這也是在Windows 98和Windows NT環境中最常用的設定. 可選的值 \fBsecurity = share\fR, \fBsecurity = server\fR 或者\fBsecurity = domain \fR. 2.0.0版本之前的Samba中,預設值是 \fBsecurity = share\fR 主要因為當時只有這一個值可選。 在WfWg裡有一個錯誤,當在使用使用者和伺服器安全級時,WfWg客戶將會完全忽略你在"connect drive"對話方塊裡鍵入的口令.這就使除了在WfWg裡已登入的使用者以外的任何人要聯接Samba服務項變得非常困難. 如果你的主機使用與UNIX主機上相同的使用者名稱時,就應當使用\fBsecurity = user\fR.如果你用的使用者名稱通常在UNIX上不存在時就應該用\fBsecurity = share\fR. 如果你想設定共享而不用口令的話(訪客級共享)也應該用\fBsecurity=share\fR.這通常用於提供共享列印的伺服器.在\fBsecurity=user\fR裡設定guest帳戶非常困難,詳細的情況請參見\fImap to guest\fR選項. \fBsmbd\fR可能會使用一種\fB混雜模式(hybrid)\fR,這樣就可以在不同的\fINetBIOS aliases\fR下提供使用者和共享級的安全特性. 現在解釋各個不同的設定. \fBSECURITY = SHARE\fR 當客戶聯接到一個共享安全級的伺服器,在聯接共享資源之前無需用一個合法的使用者名稱和口令登入到伺服器(雖然現在的客戶端象WIN95/95及NT在與\fBsecurity = share \fR的伺服器交談時都會以使用者名稱傳送一個登入請求,但卻沒有帶口令).相反,客戶端會在每一個共享上傳送認證資訊(口令)以嘗試聯接到這個共享項. 注意 \fBsmbd\fR \fB總是\fR 用合法的UNIX使用者代表客戶進行操作, 即使是在 \fBsecurity = share\fR 的時候. 因為在共享安全級中,客戶無需向伺服器傳送使用者名稱,所以\fBsmbd\fR用一些技術來為客戶決定正確的UNIX使用者賬號. 用於匹配給出客戶口令的可能的UNIX使用者名稱列表可以用以下方法建立: 如果設定了\fIguest only\fR選項,則跳過所有其它步驟只檢查\fIguest account\fR使用者名稱. 如果透過共享連線請求傳送一個使用者名稱,則此使用者名稱(對映後 - 參見\fIusername map\fR)被作為潛在使用者名稱加入. 如果客戶使用一個先前的 \fBlogon \fR 請求(SessionSetup SMB呼叫)則在SMB中傳送的使用者名稱將作為潛在使用者名稱加入. 客戶請求的服務項名被作為潛在使用者名稱加入. 客戶的NetBIOS名被作為潛在使用者名稱加入到列表中. 在\fIuser\fR列表中的任何使用者都被作為潛在使用者名稱加入. 如果未設\fIguest only\fR選項,則使用提供的口令來嘗試此列表.對於匹配到口令的第一個使用者將作為UNIX使用者身份使用. 如果設定了\fIguest only\fR選項或未檢測到使用者名稱,則如果共享項中標誌為可以使用\fIguest account\fR,那麼使用此訪客使用者賬號,否則拒絕訪問. 注意,在共享安全級中關於哪個UNIX使用者名稱最後將在允許訪問中使用\fB非常\fR混淆. 參見NOTE ABOUT USERNAME/PASSWORD VALIDATION段. \fBSECURITY = USER\fR 這是samba2.0/3.0預設安全級設定.對於使用者安全級,一個客戶必須先以合法的使用者名稱和口令(也可以用\fIusername map\fR選項程序對映)\(lq登入\(rq.在此安全模式中也可使用加密口令(參見\fIencrypted passwords\fR選項).如果設定瞭如\fIuser\fR和\fIguest only\fR這樣的選項,則它們會被應用並且在此連線上更改UNIX使用者賬號,但只能在使用者賬號被成功驗證之後才行. \fB注意\fR,當伺服器成功驗證客戶身份之前,請求的資源名稱是\fB不\fR傳送到伺服器上的.這就是為什麼使用者安全級中在沒有允許伺服器自動把未知使用者對映為\fIguest account\fR的情況下,訪客共享無法工作.參見\fImap to guest\fR選項獲得完成對映的細節. 參見NOTE ABOUT USERNAME/PASSWORD VALIDATION段. \fBSECURITY = DOMAIN\fR 只有已經用 \fBnet\fR(8)把伺服器新增進一個Windows NT的域中,此安全模式才能正常工作.它要求\fIencrypted passwords\fR選項設為\fByes\fR.在此模式中Samba將試圖把使用者名稱/口令傳送到一個WindowsNT主域或備份域控制器進行驗證像一臺真正的WindowsNT伺服器那樣。 \fB注意\fR,仍然需要存在一個和域控制器上的使用者名稱一致的有效的UNIX使用者,來使Samba擁有一個有效的UNIX帳戶來對映存取檔案操作。 \fB注意\fR,對於客戶端來說,\fIsecurity=domain\fR模式與\fIsecurity=user\fR是一樣的.它隻影響 伺服器處理驗證工作的方式.對於客戶端無任何影響. \fB注意\fR,當伺服器成功驗證客戶身份之前,請求的資源名稱是不傳送到伺服器上的.這就是為什麼域安全級中在沒有允許伺服器自動把未知使用者對映為\fBguest account\fR的情況下,訪客共享無法工作.參見\fImap to guest\fR選項獲得完成對映的細節 參見 NOTE ABOUT USERNAME/PASSWORD VALIDATION 段. 參見 \fIpassword server\fR parameter 和 \fIencrypted passwords\fR 選項。 \fBSECURITY = SERVER\fR 在此模式中Samba將試圖把使用者名稱/口令傳送到其它SMB伺服器,比如一臺NT伺服器,進行驗證.如果驗證失敗則回到\fBsecurity = user\fR模式,它需要\fIencrypted passwords\fR 引數設定為\fByes\fR,除非遠端系統不支援它們。但是要注意,如果使用了加密口令的話,samba不會再去檢查UNIX系統口令檔案的,它必須有一個合法的\fIsmbpasswd\fR檔案以再次檢查使用者賬號.參見Samba HOWTO Collection 中關於User Database 的章節來獲得如何設定的資訊。 This mode of operation has significant pitfalls, due to the fact that is activly initiates a man-in-the-middle attack on the remote SMB server\&. In particular, this mode of operation can cause significant resource consuption on the PDC, as it must maintain an active connection for the duration of the user's session\&. Furthermore, if this connection is lost, there is no way to reestablish it, and futher authenticaions to the Samba server may fail. (From a single client, till it disconnects). \fB注意\fR,對於客戶端來說,\fBsecurity=server\fR模式與\fBsecurity=user\fR是一樣的.它隻影響伺服器處理驗證工作的方式.對於客戶端無任何影響. \fB注意\fR,當伺服器成功驗證客戶身份之前,請求的資源名稱是\fB不\fR傳送到伺服器上的.這就是為什麼伺服器安全級中在沒有允許伺服器自動把未知使用者對映為\fIguest account\fR的情況下,訪客共享無法工作.參見 \fImap to guest\fR選項獲得完成對映的細節. 參見 NOTE ABOUT USERNAME/PASSWORD VALIDATION 段. 參見 \fIpassword server\fR parameter 和 \fIencrypted passwords\fR 選項。 \fBSECURITY = ADS\fR In this mode, Samba will act as a domain member in an ADS realm\&. To operate in this mode, the machine running Samba will need to have Kerberos installed and configured and Samba will need to be joined to the ADS realm using the net utility. Note that this mode does NOT make Samba operate as a Active Directory Domain Controller. Read the chapter about Domain Membership in the HOWTO for details. 參見 \fIads server \fR parameter, the \fIrealm \fR paramter 和\fIencrypted passwords\fR 選項。 預設設定: \fBsecurity = USER\fR 示例: \fBsecurity = DOMAIN\fR .TP security mask (S) 此選項控制NT客戶用本地NT安全對話方塊操作UNIX許可權時對許可權所作的修改情況. This parameter controls what UNIX permission bits can be modified when a Windows NT client is manipulating the UNIX permission on a file using the native NT security dialog box\&. 此選項用掩碼值'與'實現對許可權位的更改,從而防止修改未出現在此掩碼中的任何位.可以將掩碼中的0看作使用者無權更改的位值. This parameter is applied as a mask (AND'ed with) to the changed permission bits, thus preventing any bits not in this mask from being modified\&. Essentially, zero bits in this mask may be treated as a set of bits the user is not allowed to change\&. 如未明確設定此選項,則把此選項設為0777,允許使用者修改檔案的所有user/group/world這些許可權. \fB注意\fR,可透過其它手段訪問到Samba伺服器的使用者可以輕而易舉地繞過此限制,所以此選項只對獨立的伺服器系統有用.多數普通系統的管理員可以將它保留為\fB0777\fR. 參見 \fIforce directory security mode\fR, \fIdirectory security mask\fR, \fIforce security mode\fR 選項. 預設設定: \fBsecurity mask = 0777\fR 示例: \fBsecurity mask = 0770\fR .TP server schannel (G) This controls whether the server offers or even demands the use of the netlogon schannel\&. \fIserver schannel = no\fR does not offer the schannel, \fIserver schannel = auto\fR offers the schannel but does not enforce it, and \fIserver schannel = yes\fR denies access if the client is not able to speak netlogon schannel\&. This is only the case for Windows NT4 before SP4\&. Please note that with this set to \fIno\fR you will have to apply the WindowsXP requireSignOrSeal-Registry patch found in the docs/Registry subdirectory\&. 預設設定: \fBserver schannel = auto\fR 示例: \fBserver schannel = yes\fR .TP server signing (G) This controls whether the server offers or requires the client it talks to to use SMB signing\&. Possible values are \fBauto\fR, \fBmandatory\fR and \fBdisabled\fR\&. When set to auto, SMB signing is offered, but not enforced\&. When set to mandatory, SMB signing is required and if set to disabled, SMB signing is not offered either\&. 預設設定: \fBclient signing = False\fR .TP server string (G) 此選項在列印管理器中的印表機資訊對話方塊以及在\fBnet view\fR(網路上的芳鄰)的IPC連線中顯示的伺服器資訊.它可以是任何你希望向使用者顯示的字串. 它還設定顯示在瀏覽列表中主機名後的內容. \fI%v\fR 將替換為Samba版本號 \fI%h\fR 將替換為主機名 預設設定: \fBserver string = Samba %v\fR 示例: \fBserver string = University of GNUs Samba Server\fR .TP set directory (S) 如果 \fBset directory = no\fR,則使用服務的使用者不能用setdir命令更變目錄. \fBsetdir\fR命令只在Digital Pathworks客戶端中實現.參見Pathworks文件的細節. 預設設定: \fBset directory = no\fR .TP set primary group script (G) Thanks to the Posix subsystem in NT a Windows User has a primary group in addition to the auxiliary groups\&. This script sets the primary group in the unix userdatase when an administrator sets the primary group from the windows user manager or when fetching a SAM with \fBnet rpc vampire\fR\&. \fI%u\fR will be replaced with the user whose primary group is to be set\&. \fI%g\fR will be replaced with the group to set\&. 預設設定: \fBNo default value\fR 示例: \fBset primary group script = /usr/sbin/usermod -g '%g' '%u'\fR .TP set quota command (G) The \fBset quota command\fR should only be used whenever there is no operating system API available from the OS that samba can use\&. This parameter should specify the path to a script that can set quota for the specified arguments\&. The specified script should take the following arguments: 1 - quota type .TP 3 \(bu 1 - user quotas .TP \(bu 2 - user default quotas (uid = -1) .TP \(bu 3 - group quotas .TP \(bu 4 - group default quotas (gid = -1) .LP 2 - id (uid for user, gid for group, -1 if N/A) 3 - quota state (0 = disable, 1 = enable, 2 = enable and enforce) 4 - block softlimit 5 - block hardlimit 6 - inode softlimit 7 - inode hardlimit 8(optional) - block size, defaults to 1024 The script should output at least one line of data\&. 參見 \fIget quota command\fR 選項。 預設設定: \fBset quota command = \fR 示例: \fBset quota command = /usr/local/sbin/set_quota\fR .TP share modes (S) 此選項在一個檔案開啟時允許或禁止\fIshare modes\fR.此模式可用於使客戶獲得對一個檔案獨佔的讀或寫訪問. 這些開啟模式UNIX是不直接支援的,所以要用共享記憶體或在UNIX不支援共享記憶體時(一般都支援)用鎖定檔案來模擬. 允許共享模式的選項是\fBDENY_DOS\fR, \fBDENY_ALL\fR, \fBDENY_READ\fR,\fBDENY_WRITE\fR, \fBDENY_NONE\fR 和\fBDENY_FCB\fR. 預設情況下此選項提供了完全的共享相容和許可. 你 \fB不應\fR 把此選項關閉因為很多Windows應用會因此停止執行。 預設設定: \fBshare modes = yes\fR .TP short preserve case (S) 此布林值選項控制著如果新檔案符合8.3檔名格式(所有字母都為大寫且長度適當),則以大寫字母建立檔案,否則就轉換為\fIdefault case \fR.此選項可與\fBpreserve case = yes\fR選項聯用,以允許長檔名保留大小寫,同時短檔名轉換為小寫。 參見 NAME MANGLING 段. 預設設定: \fBshort preserve case = yes\fR .TP show add printer wizard (G) With the introduction of MS-RPC based printing support for Windows NT/2000 client in Samba 2\&.2, a "Printers\&.\&.\&." folder will appear on Samba hosts in the share listing\&. Normally this folder will contain an icon for the MS Add Printer Wizard (APW)\&. However, it is possible to disable this feature regardless of the level of privilege of the connected user\&. Under normal circumstances, the Windows NT/2000 client will open a handle on the printer server with OpenPrinterEx() asking for Administrator privileges\&. If the user does not have administrative access on the print server (i\&.e is not root or a member of the \fIprinter admin\fR group), the OpenPrinterEx() call fails and the client makes another open call with a request for a lower privilege level\&. This should succeed, however the APW icon will not be displayed\&. Disabling the \fIshow add printer wizard\fR parameter will always cause the OpenPrinterEx() on the server to fail\&. Thus the APW icon will never be displayed\&. \fB Note :\fRThis does not prevent the same user from having administrative privilege on an individual printer\&. 參見 \fIaddprinter command\fR, \fIdeleteprinter command\fR, \fIprinter admin\fR Default :\fBshow add printer wizard = yes\fR .TP shutdown script (G) \fBThis parameter only exists in the HEAD cvs branch\fR This a full path name to a script called by \fBsmbd\fR(8) that should start a shutdown procedure\&. This command will be run as the user connected to the server\&. %m %t %r %f parameters are expanded: \fI%m\fR will be substituted with the shutdown message sent to the server\&. \fI%t\fR will be substituted with the number of seconds to wait before effectively starting the shutdown procedure\&. \fI%r\fR will be substituted with the switch \fB-r\fR\&. It means reboot after shutdown for NT\&. \fI%f\fR will be substituted with the switch \fB-f\fR\&. It means force the shutdown even if applications do not respond for NT\&. 預設設定: \fBNone\fR\&. 示例: \fBshutdown script = /usr/local/samba/sbin/shutdown %m %t %r %f\fR Shutdown script example: .nf #!/bin/bash $time=0 let "time/60" let "time++" /sbin/shutdown $3 $4 +$time $1 & .fi Shutdown does not return so we need to launch it in background\&. 參見 \fIabort shutdown script\fR\&. .TP smb passwd file (G) 此選項設定加密口令檔案smbpasswd的路徑.預設路徑在編譯samba時指定. 預設設定: \fBsmb passwd file = ${prefix}/private/smbpasswd\fR 示例: \fBsmb passwd file = /etc/samba/smbpasswd\fR .TP smb ports (G) Specifies which ports the server should listen on for SMB traffic\&. 預設設定: \fBsmb ports = 445 139\fR .TP socket address (G) 此選項允許你控制samba監聽連線所用的地址.它用於在一個伺服器上支援多個配置不同的虛擬介面.預設情況下samba會在任何地址上都接受連線請求. By default Samba will accept connections on any address\&. 示例: \fBsocket address = 192.168.2.20\fR .TP socket options (G) 此選項設定用於與客戶端交談的套接字選項. 套接字選項是使用在允許調整連線的作業系統的網路層的控制命令. 此選項通常用於在區域網上最佳化調整samba伺服器的效能.因為samba無法知道與你的網路所對應的最佳化選項,所以你必須自己進行試驗並作出選擇.我們強烈推薦你先閱讀與你的作業系統有關的相應檔案(也許\fBman setsockopt\fR會有幫助). 你可能會發現在有些系統上samba會在你使用一個選項時發出"Unknown socket option"的資訊.這就說明你沒有正確拼寫或者需要為作業系統新增一個包含檔案到includes.h中.如有後面指出的問題請寫信到samba-bugs@samba.org. 只要作業系統允許,你可以以任何方法組合任何所支援的套接字選項. 當前可用於此選項的可設定套接字選項列表有: SO_KEEPALIVE SO_REUSEADDR SO_BROADCAST TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT SO_SNDBUF * SO_RCVBUF * SO_SNDLOWAT * SO_RCVLOWAT * 標有\fB'*'\fR的要使用一個整數引數.其它的有時使用1或0代表允許或禁止該選項,如未指定1或0則預設值都為允許. 要指定一個變數,用"SOME_OPTION=VALUE"格式。比如可以是SO_SNDBUF=8192.注意,在"="前後不能有任何空格. 如在區域網上,則使用下面這個是比較明智的: \fBsocket options = IPTOS_LOWDELAY\fR 如有一個區域網則可以試一下: \fBsocket options = IPTOS_LOWDELAY TCP_NODELAY\fR 如有一個廣域網,則試一下IPTOS_THROUGHPU. 注意有些選項可導致samba伺服器完全失效.小心使用它們! 預設設定: \fBsocket options = TCP_NODELAY\fR 示例: \fBsocket options = IPTOS_LOWDELAY\fR .TP source environment (G) This parameter causes Samba to set environment variables as per the content of the file named\&. If the value of this parameter starts with a "|" character then Samba will treat that value as a pipe command to open and will set the environment variables from the output of the pipe\&. The contents of the file or the output of the pipe should be formatted as the output of the standard Unix \fBenv(1)\fR command\&. This is of the form: Example environment entry: \fBSAMBA_NETBIOS_NAME = myhostname\fR 預設設定: \fBNo default value\fR Examples: \fBsource environment = |/etc/smb.conf.sh\fR 示例: \fBsource environment = /usr/local/smb_env_vars\fR .TP stat cache (G) 此選項檢測\fBsmbd\fR(8)是否使用快取以提升對映不分大小寫名稱的速度.你無須更改此選項. 預設設定: \fBstat cache = yes\fR .TP strict allocate (S) This is a boolean that controls the handling of disk space allocation in the server\&. When this is set to \fByes\fR the server will change from UNIX behaviour of not committing real disk storage blocks when a file is extended to the Windows behaviour of actually forcing the disk system to allocate real storage blocks when a file is created or extended to be a given size\&. In UNIX terminology this means that Samba will stop creating sparse files\&. This can be slow on some systems\&. When strict allocate is \fBno\fR the server does sparse disk block allocation when a file is extended\&. Setting this to \fByes\fR can help Samba return out of quota messages on systems that are restricting the disk quota of users\&. 預設設定: \fBstrict allocate = no\fR .TP strict locking (S) 此布林量選項控制伺服器對檔案鎖的處理.當設為\fByes\fR,則伺服器對檔案鎖檢查每次讀寫訪問,並拒絕鎖存在時的訪問.在有些系統上這可能會很慢. 當禁用strict locking時,伺服器只在客戶明確要求時才為他們檢查檔案鎖. 循規蹈矩的客戶總是在重要的時候要求檢查檔案鎖,所以在多數情況下\fBstrict locking = no\fR是可取的. 預設設定: \fBstrict locking = no\fR .TP strict sync (S) 很多Windows應用(包括Windows 98瀏覽器)都會干擾對重新整理緩衝區內容到磁碟的操作.在UNIX下,一次同步呼叫強制程序掛起,直到核心確保把所有磁碟快取區中的未完成資料安全地存到固定儲存裝置中為止.此操作很慢,而且只能很少用到.把此選項設為\fBno\fR (預設值)說明\fBsmbd\fR(8) 忽略Windows應用請求的一次同步呼叫.這樣只有在Samba執行的作業系統崩潰時才可能丟失資料,因此預設設定危險性很小.另外,它修正人們報告的很多關於Windows98瀏覽器複製檔案的效能問題. 參見 \fIsync always\fR 選項。 預設設定: \fBstrict sync = no\fR .TP sync always (S) 此布林量選項控制是否在寫操作結束前把所寫的內容寫到固定儲存裝置上.如果為\fBno\fR則伺服器將在每次寫呼叫中讓客戶請求來操縱它(客戶可以設定一個位碼來指出要同步一次特殊的寫操作).如果為\fByes\fR則在每次寫操作後呼叫一次\fBfsync() \fR以確保將資料寫到磁碟上.注意必須把\fIstrict sync\fR選項設為\fByes\fR以使本選項產生效果. 參見 \fIstrict sync\fR 選項。 預設設定: \fBsync always = no\fR .TP syslog (G) 此選項決定samba除錯資訊號如何對映為系統syslog的記錄等級.除錯級0對映為syslog的\fBLOG_ERR\fR,除錯級1對映為 \fBLOG_WARNING\fR,除錯級2對映為\fBLOG_NOTICE\fR,除錯級3對映為\fBLOG_INFO\fR.所有更高的級別號對映為\fB LOG_DEBUG\fR. 此選項設定了對syslog傳送資訊的閾值.只有小於此值的除錯級資訊號才發給syslog. 預設設定: \fBsyslog = 1\fR .TP syslog only (G) 此選項使samba只把除錯級別號記錄到系統syslog,而不是除錯記錄檔案. 預設設定: \fBsyslog only = no\fR .TP template homedir (G) When filling out the user information for a Windows NT user, the \fBwinbindd\fR(8) daemon uses this parameter to fill in the home directory for that user\&. If the string \fI%D\fR is present it is substituted with the user's Windows NT domain name\&. If the string \fI%U\fR is present it is substituted with the user's Windows NT user name\&. 預設設定: \fBtemplate homedir = /home/%D/%U\fR .TP template primary group (G) This option defines the default primary group for each user created by \fBwinbindd\fR(8)'s local account management functions (similar to the 'add user script')\&. 預設設定: \fBtemplate primary group = nobody\fR .TP template shell (G) When filling out the user information for a Windows NT user, the \fBwinbindd\fR(8) daemon uses this parameter to fill in the login shell for that user\&. 預設設定: \fBtemplate shell = /bin/false\fR .TP time offset (G) 此選項是個加入到轉換標準GMT為當地時間操作的分鐘數.如果你向很多有不正確儲存時間操作的主機提供服務時這就很有用了. 預設設定: \fBtime offset = 0\fR 示例: \fBtime offset = 60\fR .TP time server (G) 此選項檢測\fBnmbd\fR(8) 是否以時間伺服器身份向Windows客戶通告自身. 預設設定: \fBtime server = no\fR .TP timestamp logs (G) 與 \fI debug timestamp\fR 同義. .TP unicode (G) Specifies whether Samba should try to use unicode on the wire by default\&. Note: This does NOT mean that samba will assume that the unix machine uses unicode! 預設設定: \fBunicode = yes\fR .TP unix charset (G) Specifies the charset the unix machine Samba runs on uses\&. Samba needs to know this in order to be able to convert text to the charsets other SMB clients use\&. 預設設定: \fBunix charset = UTF8\fR 示例: \fBunix charset = ASCII\fR .TP unix extensions (G) This boolean parameter controls whether Samba implments the CIFS UNIX extensions, as defined by HP\&. These extensions enable Samba to better serve UNIX CIFS clients by supporting features such as symbolic links, hard links, etc\&.\&.\&. These extensions require a similarly enabled client, and are of no current use to Windows clients\&. 預設設定: \fBunix extensions = yes\fR .TP unix password sync (G) 此布林量選項控制samba是否在smbpasswd檔案中的加密SMB口令被更改時嘗試用SMB口令來同步UNIX口令.如設為\fByes\fR則\fB以root身份\fR呼叫\fIpasswd program\fR選項中指定的程式 - 以允許設定新的UNIX口令而無需訪問原UNIX口令(因為更改SMB口令時程式碼不訪問明文的原口令而只涉及新口令). 參見 \fIpasswd program\fR, \fI passwd chat\fR. 預設設定: \fBunix password sync = no\fR .TP update encrypted (G) 此布林量選項使以明文口令登入的使用者在登入時自動更新smbpasswd檔案中的加密 (雜湊計算過的)口令.此選項允許一個站點從明文口令驗證方式(以明文口令驗證用 戶賬號並再次檢查UNIX賬號資料庫)移植到加密口令驗證方式(SMB的詢問/響應驗證 機制)而無需強制所有使用者在移植時透過smbpasswd重新輸入他們的口令.這對改變加 密口令移交要較長週期這種狀況來說很方便.一旦所有使用者都在smbpasswd檔案中擁 有他們加密過的口令,則此應該把此選項設為\fBno\fR. 為了讓此選項正確工作,當它設為\fByes\fR時必須把 \fIencrypt passwords\fR選項設為\fBno\fR . 注意即使設定了此選項,\fBsmbd\fR還是必須驗證使用者賬號,直到輸入合法的口令後才能正確連線並更新他們的雜湊計算(由smbpasswd完成)後的口令字. 預設設定: \fBupdate encrypted = no\fR .TP use client driver (S) This parameter applies only to Windows NT/2000 clients\&. It has no effect on Windows 95/98/ME clients\&. When serving a printer to Windows NT/2000 clients without first installing a valid printer driver on the Samba host, the client will be required to install a local printer driver\&. From this point on, the client will treat the print as a local printer and not a network printer connection\&. This is much the same behavior that will occur when \fBdisable spoolss = yes\fR\&. The differentiating factor is that under normal circumstances, the NT/2000 client will attempt to open the network printer using MS-RPC\&. The problem is that because the client considers the printer to be local, it will attempt to issue the OpenPrinterEx() call requesting access rights associated with the logged on user\&. If the user possesses local administator rights but not root privilegde on the Samba host (often the case), the OpenPrinterEx() call will fail\&. The result is that the client will now display an "Access Denied; Unable to connect" message in the printer queue window (even though jobs may successfully be printed)\&. If this parameter is enabled for a printer, then any attempt to open the printer with the PRINTER_ACCESS_ADMINISTER right is mapped to PRINTER_ACCESS_USE instead\&. Thus allowing the OpenPrinterEx() call to succeed\&. \fBThis parameter MUST not be able enabled on a print share which has valid print driver installed on the Samba server\&.\fR 參見 \fIdisable spoolss\fR 預設設定: \fBuse client driver = no\fR .TP use mmap (G) This global parameter determines if the tdb internals of Samba can depend on mmap working correctly on the running system\&. Samba requires a coherent mmap/read-write system memory cache\&. Currently only HPUX does not have such a coherent cache, and so this parameter is set to \fBno\fR by default on HPUX\&. On all other systems this parameter should be left alone\&. This parameter is provided to help the Samba developers track down problems with the tdb internal code\&. 預設設定: \fBuse mmap = yes\fR .TP user (S) 與 \fIusername\fR 同義 .TP username (S) 在逗號分隔的列表中指定多個使用者以用於輪流(從左到右)測試所提供的口令. 只有當主機無法提供它自己的使用者名稱時才需要\fIusername\fR選項。當用COREPLUS 協議或你的使用者擁有與UNIX使用者名稱不同的WfWg使用者名稱時就會有這樣的情況.在這兩種 情況下,用\\\\server\\share%user語句代替會更好的. 在大多數情況下\fIusername\fR選項並不是最好的解決方案,因為它意味著Samba會 嘗試對\fIusername\fR選項行中的每個使用者名稱輪流作測試.這樣做是很慢的,而且萬 一很多使用者重複口令的話這就是個壞主意了.錯誤使用此選項可能會帶來超時或安全 缺陷. samba依靠底層的UNIX安全.此選項不限制登入者,它只對Samba伺服器提供響應所提 供口令的使用者名稱的線索.任何喜歡的人都可以登入,而且如果他們只是啟動一次 telnet對話的話不會造成破壞.程序以登入的使用者身份執行,所以他們無法做任何他 們不能做的事兒. 要對一組特殊的使用者限制一個服務的話可以用 \fIvalid users \fR 選項. 如果任何使用者名稱以'@'字元開始則此使用者名稱將首先在NIS網路組列表(如果Samba編譯 時加入了網路組支援的話)中進行查詢,然後在UNIX使用者組資料庫中查詢並展開成屬 於以此名為組的所有使用者的列表. 如果任何使用者名稱以'+'字元開始則此使用者名稱只在UNIX使用者組資料庫中進行查詢並展開成屬於以此名為組的所有使用者的列表. 如果任何使用者名稱以'&'字元開始則此使用者名稱只在NIS網路組列表(如果Samba編譯時加入了網路組支援的話)中進行查詢並展開成屬於以此名為組的所有使用者的列表. 注意透過使用者組資料庫進行查詢要花很長時間,在此期間有些客戶可能會超時. 檢視 NOTE ABOUT USERNAME/PASSWORD VALIDATION 段來獲得這個選項如何決定訪問服務方面的資訊。 預設設定: \fB如果是guest服務就是guest帳號,否則是空字串.\fR 示例:\fBusername = fred, mary, jack, jane, @users, @pcgroup\fR .TP username level (G) 此選項在很多DOS客戶傳送全大寫的使用者名稱時,幫助samba嘗試和\(lq猜測\(rq實際 UNIX使用者名稱.對於預設情況,Samba嘗試所有小寫形式,然後是首字母大寫形式,如果該 使用者名稱在UNIX主機上沒有找到則失敗. 如果把此選項設為非0,則情況就改變了.此選項指定的是用於嘗試同時檢測UNIX使用者名稱的大寫字母的組合數.數字越高,則嘗試的組合數越多,但使用者名稱的發現也越慢.當在你的UNIX主機上有奇特的使用者名稱如\fBAstrangeUser \fR時使用此選項. 預設設定: \fBusername level = 0\fR 示例: \fBusername level = 5\fR .TP username map (G) 此選項允許你指定一個包含對客戶機到伺服器上的使用者名稱對映的檔案.它可用於幾個目的.最常見的是把用DOS或Windows主機的使用者的名稱對映到UNIX主機上的使用者.其它還有把多個使用者對映到單個使用者名稱上以使他們可以更簡單地共享檔案. 對映檔案被逐行解析.每個行都應該在'='號左邊包含一個UNIX使用者名稱,而在右邊跟上一列使用者名稱.右邊的使用者名稱列表可以包含@group形式的名稱,它表示匹配任何組中的UNIX使用者名稱.特殊客戶名'*'是一個萬用字元用於匹配任何名稱.對映檔案的每個行可以達到1023個字元的長度. 對檔案的處理是在每個行上取得提供的使用者名稱並把它與'='號右邊的每個使用者名稱進行比較.如果提供的名稱匹配右邊的任何名稱則用左邊的名稱替換右邊的.然後繼續處理下一行. 忽略以'#' 或 ';'號開始的行. 當在行中發現了匹配,則在以'!'開始的行後中止處理,否則繼續處理每一行的對映.當你在檔案中用了通配對映的話'!'就很有用了. 例如把名稱\fBadmin\fR 或 \fBadministrator\fR對映為UNIX名\fB root\fR,你可以這樣: \fBroot = admin administrator\fR 或把UNIX組 \fBsystem\fR中的任何人對映為UNIX名\fBsys\fR就可以這樣: \fBsys = @system\fR 可以在一個使用者名稱對映檔案中包含很多對映關係. 如果你的系統支援NIS NETGROUP選項,則在使用\fI/etc/group \fR匹配組之前先檢查網路組資料庫. 你可以透過在名稱上使用雙引號來對映含有空格的Windows使用者名稱.例如: \fBtridge = "Andrew Tridgell"\fR 將把windows使用者名稱"Andrew Tridgell"對映為unix使用者名稱"tridge". 以下示例將把mary和fred對映為unix使用者sys,然後把其餘的對映為guest.注意使用'!'符號可以告訴Samba如果在該行獲得一個匹配的話就停止處理. .nf !sys = mary fred guest = * .fi 注意重對映作用於所有出現使用者名稱的地方.因此如果你連線到\\\\server\\fred而\fB fred\fR已被重對映為 \fBmary\fR,則你實際會連線到\\\\server\\mary"並需要提供\fBmary\fR的口令而不是 \fBfred\fR的.這種情況只有一個例外,那就是使用者名稱是被傳到\fI password server\fR(如果你有一個的話)驗證的.口令伺服器會接收客戶提供的未經修改的使用者名稱. 同時要注意反向對映是不會出現的.這主要影響的是列印任務.已經被對映的使用者會在刪除列印任務時遇到麻煩,因為WfWg上的列印管理器會認為他們不是列印任務的屬主. 預設設定: \fBno username map\fR 示例: \fBusername map = /usr/local/samba/lib/users.map\fR .TP users (S) 與 \fI username\fR 同義. .TP use sendfile (S) If this parameter is \fByes\fR, and Samba was built with the --with-sendfile-support option, and the underlying operating system supports sendfile system call, then some SMB read calls (mainly ReadAndX and ReadRaw) will use the more efficient sendfile system call for files that are exclusively oplocked\&. This may make more efficient use of the system CPU's and cause Samba to be faster\&. This is off by default as it's effects are unknown as yet\&. 預設設定: \fBuse sendfile = no\fR .TP use spnego (G) This variable controls controls whether samba will try to use Simple and Protected NEGOciation (as specified by rfc2478) with WindowsXP and Windows2000 clients to agree upon an authentication mechanism\&. Unless further issues are discovered with our SPNEGO implementation, there is no reason this should ever be disabled\&. 預設設定: \fBuse spnego = yes\fR .TP utmp (G) This boolean parameter is only available if Samba has been configured and compiled with the option \fB --with-utmp\fR\&. If set to \fByes\fR then Samba will attempt to add utmp or utmpx records (depending on the UNIX system) whenever a connection is made to a Samba server\&. Sites may use this to record the user connecting to a Samba share\&. Due to the requirements of the utmp record, we are required to create a unique identifier for the incoming user\&. Enabling this option creates an n^2 algorithm to find this number\&. This may impede performance on large installations\&. 參見 \fI utmp directory\fR 選項。 預設設定: \fButmp = no\fR .TP utmp directory (G) This parameter is only available if Samba has been configured and compiled with the option \fB --with-utmp\fR\&. It specifies a directory pathname that is used to store the utmp or utmpx files (depending on the UNIX system) that record user connections to a Samba server\&. 參見 \fIutmp\fR 選項。 By default this is not set, meaning the system will use whatever utmp file the native system is set to use (usually \fI/var/run/utmp\fR on Linux)\&. 預設設定: \fBno utmp directory\fR 示例: \fButmp directory = /var/run/utmp\fR .TP -valid (S) This parameter indicates whether a share is valid and thus can be used\&. When this parameter is set to false, the share will be in no way visible nor accessible\&. This option should not be used by regular users but might be of help to developers\&. Samba uses this option internally to mark shares as deleted\&. 預設設定: \fBTrue\fR .TP valid users (S) 這是一份允許登入服務項的使用者列表.以'@','+'和'&'開始的名稱用\fIinvalid users\fR 選項中的規則進行解析. 如果此項為空(預設)則任何使用者都可以登入.如果一個使用者名稱同時存在於此列表及\fIinvalid users\fR列表,則拒絕此使用者訪問. \fI%S \fR替換為當前服務名. 這在[homes]段裡非常有用. 參見 \fIinvalid users \fR 預設設定: \fB空 (任何人都不會被拒絕) \fR 示例: \fBvalid users = greg, @pcusers\fR .TP veto files (S) 這是一份既不可見又不可訪問的檔案及目錄的列表.在列表中的每一項必須用'/'進行分隔,專案中允許有空格.可以用DOS萬用字元'*'和'?'來指定多個檔案或目錄. 每項必須是一個UNIX路徑,而非一個DOS路徑,同時\fB必須不含\fR UNIX目錄分隔符'/'. 注意\fIcase sensitive\fR選項適用於對檔案的禁止目的. 需要明白這個選項的很重要的一個特點: 在Samba刪除一個目錄時的行為。如果一個目錄除了veto files之外不包含任何內容,刪除操作將\fB失敗\fR,除非設定了\fIdelete veto files\fR 是\fIyes\fR. 設定此選項會影響Samba的效能,因為它將強制在掃描所有檔案和目錄時檢查是否匹配. 參見 \fIhide files \fR 和 \fI case sensitive\fR. 預設設定: \fB沒有隱藏任何檔案. \fR 示例: .nf ; 隱藏任何檔名帶有'Security'的檔案, ; 任何副檔名是.tmp的檔案,任何檔名帶有'root'的檔案 veto files = /*Security*/*\&.tmp/*root*/ ; 隱藏NetAtalk伺服器建立的Apple專用的檔案 veto files = /\&.AppleDouble/\&.bin/\&.AppleDesktop/Network Trash Folder/ .fi .TP veto oplock files (S) 此選項只在對一個共享打開了\fIoplocks\fR選項時才有效.它允許Samba管理員在所選檔案上選擇性地關閉允許oplocks,這些檔案可以用萬用字元列表來匹配,類擬於在\fIveto files\fR 選項中所用的萬用字元列表. 預設設定: \fB沒有隱藏oplocks許可\fR 你可能想在已知客戶會猛烈爭奪的檔案上使用此項.在NetBench SMB基準程式下面就是個好例子,它導致客戶猛烈地對以\fI.SEM\fR字尾的檔案進行連線.為使Samba不在這些檔案上允許oplocks,你可以在[global]段或特定的NetBench共享中使用此行: 示例: \fBveto oplock files = /*.SEM/\fR .TP vfs object (S) 與 \fIvfs objects\fR 同義. .TP vfs objects (S) This parameter specifies the backend names which are used for Samba VFS I/O operations\&. By default, normal disk I/O operations are used but these can be overloaded with one or more VFS objects\&. 預設設定: \fBno value\fR 示例: \fBvfs objects = extd_audit recycle\fR .TP volume (S) 此選項允許你忽略共享項提供的卷標.這對於那些堅持要使用一個特殊卷標的安裝程式光碟來說很有用.預設就是共享項的卷標. 預設設定: \fB共享的名稱\fR .TP wide links (S) 此選項控制伺服器是否跟蹤UNIX檔案系統中的符號連結.指向伺服器匯出的目錄樹的連結總是被允許的;此選項只是控制對匯出目錄樹以外的區域的訪問情況. 注意設定此選項可對伺服器效能產生負面影響,因為samba必須做一些額外的系統呼叫以檢查那些連結. 預設設定: \fBwide links = yes\fR .TP winbind cache time (G) This parameter specifies the number of seconds the \fBwinbindd\fR(8) daemon will cache user and group information before querying a Windows NT server again\&. 預設設定: \fBwinbind cache type = 300\fR .TP winbind enable local accounts (G) This parameter controls whether or not winbindd will act as a stand in replacement for the various account management hooks in smb\&.conf (e\&.g\&. 'add user script')\&. If enabled, winbindd will support the creation of local users and groups as another source of UNIX account information available via getpwnam() or getgrgid(), etc\&.\&.\&. 預設設定: \fBwinbind enable local accounts = yes\fR .TP winbind enum groups (G) On large installations using \fBwinbindd\fR(8) it may be necessary to suppress the enumeration of groups through the \fBsetgrent()\fR, \fBgetgrent()\fR and \fBendgrent()\fR group of system calls\&. If the \fIwinbind enum groups\fR parameter is \fBno\fR, calls to the \fBgetgrent()\fR system call will not return any data\&. \fBWarning:\fR Turning off group enumeration may cause some programs to behave oddly\&. 預設設定: \fBwinbind enum groups = yes \fR .TP winbind enum users (G) On large installations using \fBwinbindd\fR(8) it may be necessary to suppress the enumeration of users through the \fBsetpwent()\fR, \fBgetpwent()\fR and \fBendpwent()\fR group of system calls\&. If the \fIwinbind enum users\fR parameter is \fBno\fR, calls to the \fBgetpwent\fR system call will not return any data\&. \fBWarning:\fR Turning off user enumeration may cause some programs to behave oddly\&. For example, the finger program relies on having access to the full user list when searching for matching usernames\&. 預設設定: \fBwinbind enum users = yes \fR .TP winbind gid (G) This parameter is now an alias for \fBidmap gid\fR The winbind gid parameter specifies the range of group ids that are allocated by the \fBwinbindd\fR(8) daemon\&. This range of group ids should have no existing local or NIS groups within it as strange conflicts can occur otherwise\&. 預設設定: \fBwinbind gid = <空字串>\fR 示例: \fBwinbind gid = 10000-20000\fR .TP winbind separator (G) This parameter allows an admin to define the character used when listing a username of the form of \fIDOMAIN \fR\\\fIuser\fR\&. This parameter is only applicable when using the \fIpam_winbind\&.so\fR and \fInss_winbind\&.so\fR modules for UNIX services\&. Please note that setting this parameter to + causes problems with group membership at least on glibc systems, as the character + is used as a special character for NIS in /etc/group\&. 預設設定: \fBwinbind separator = '\'\fR 示例: \fBwinbind separator = +\fR .TP winbind trusted domains only (G) This parameter is designed to allow Samba servers that are members of a Samba controlled domain to use UNIX accounts distributed vi NIS, rsync, or LDAP as the uid's for winbindd users in the hosts primary domain\&. Therefore, the user 'SAMBA\\user1' would be mapped to the account 'user1' in /etc/passwd instead of allocating a new uid for him or her\&. 預設設定: \fBwinbind trusted domains only = \fR .TP winbind uid (G) This parameter is now an alias for \fBidmap uid\fR The winbind gid parameter specifies the range of user ids that are allocated by the \fBwinbindd\fR(8) daemon\&. This range of ids should have no existing local or NIS users within it as strange conflicts can occur otherwise\&. 預設設定: \fBwinbind uid = <空字串>\fR 示例: \fBwinbind uid = 10000-20000\fR .TP winbind use default domain (G) This parameter specifies whether the \fBwinbindd\fR(8) daemon should operate on users without domain component in their username\&. Users without a domain component are treated as is part of the winbindd server's own domain\&. While this does not benifit Windows users, it makes SSH, FTP and e-mail function in a way much closer to the way they would in a native unix system\&. 預設設定: \fBwinbind use default domain = \fR 示例: \fBwinbind use default domain = yes\fR .TP wins hook (G) 當把Samba作為一臺WINS伺服器執行時,此選項允許你呼叫一個外部程式更改WINS資料庫.此項主要用於動態更新外部名字解析資料庫,如動態DNS. 此選項以如下形式指定要呼叫的一個指令碼名或可執行程式: \fBwins_hook operation name nametype ttl IP_list\fR 第一部分引數是opration(運算子),它有三種:"add"、"delete"和"refresh".在很多情況下該運算子可以忽略,因為其它選項可提供足夠的資訊.注意當有名稱以前沒有加入過,則有時會用到"refresh",在這種情況下,它應該和"add"有同樣含義. 第二部分引數是netbios名.如果該名稱不是合法名的話,該功能就不執行.合法的名稱應只包含字母,數字,減號,下劃線和句點. 第三部分引數是用2位十六進位制數字表示的netbios名稱型別. 第四部分引數是以秒計算的名稱有效時間TTL (time to live). 第五部分是當前該名稱所註冊的IP地址表.如果表為空則該名稱被刪除. 一個呼叫BIND動態DNS更新程式\fBnsupdate\fR的指令碼示例在samba原始碼的示例目錄可以找到. .TP wins partners (G) A space separated list of partners' IP addresses for WINS replication\&. WINS partners are always defined as push/pull partners as defining only one way WINS replication is unreliable\&. WINS replication is currently experimental and unreliable between samba servers\&. 預設設定: \fBwins partners = \fR 示例: \fBwins partners = 192.168.0.1 172.16.1.2\fR .TP wins proxy (G) 此布林量選項控制\fBnmbd\fR(8) 是否代替其它主機響應廣播名字查詢.對一些舊版本客戶就可能需要把它設為\fByes\fR . 預設設定: \fBwins proxy = no\fR .TP wins server (G) 此選項指定nmbd要註冊的WINS伺服器的IP地址(或DNS域名:IP地址優先(for preference)).如果在你的網路上有一臺WINS伺服器,就應該把此項設為該伺服器的IP地址. 如果你有多個子網的話,應該指定向你的WINS伺服器 If you want to work in multiple namespaces, you can give every wins server a 'tag'. For each tag, only one (working) server will be queried for a name. The tag should be seperated from the ip address by a colon. 注意,如有多子網並希望跨子網瀏覽工作正常的話,應該設定Samba指向一臺WINS伺服器. 預設設定: \fB未啟用\fR 示例: \fBwins server = mary:192.9.200.1 fred:192.168.3.199 mary:192.168.2.61\fR For this example when querying a certain name, 192.19.200.1 will be asked first and if that doesn't respond 192.168.2.61 . If either of those doesn't know the name 192.168.3.199 will be queried. 示例: \fBwins server = 192.9.200.1 192.168.2.61\fR .TP wins support (G) 此布林量選項控制\fBnmbd\fR(8)程序是否作為WINS伺服器.你不應該把它設為\fByes\fR,除非有多子網或希望特定的\fBnmbd\fR作為你的WINS伺服器.注意在網路上有多臺WINS伺服器時\fB不\fR應把它設為\fByes\fR. 預設設定: \fBwins support = no\fR .TP workgroup (G) 此選項規定Samba所在的工作組以便讓客戶查詢.注意它也規定在使用\fBsecurity = domain\fR時所用的域名. 預設設定: \fB編譯時設定為 WORKGROUP\fR 示例: \fBworkgroup = MYGROUP\fR .TP writable (S) 與 \fI writeable\fR 相同,是為拼寫錯誤者準備的 :-) .TP writeable (S) 注意它與 \fIread only\fR 反義. .TP write cache size (S) If this integer parameter is set to non-zero value, Samba will create an in-memory cache for each oplocked file (it does \fBnot\fR do this for non-oplocked files)\&. All writes that the client does not request to be flushed directly to disk will be stored in this cache if possible\&. The cache is flushed onto disk when a write comes in whose offset would not fit into the cache or when the file is closed by the client\&. Reads for the file are also served from this cache if the data is stored within it\&. This cache allows Samba to batch client writes into a more efficient write size for RAID disks (i\&.e\&. writes may be tuned to be the RAID stripe size) and can improve performance on systems where the disk subsystem is a bottleneck but there is free memory for userspace programs\&. The integer parameter specifies the size of this cache (per oplocked file) in bytes\&. 預設設定: \fBwrite cache size = 0\fR 示例: \fBwrite cache size = 262144\fR for a 256k cache size per file\&. .TP write list (S) 此選項設定對服務項有讀寫權的使用者列表.如果正在連線的使用者屬於此列表,那他們就可以有寫入權,而不管\fIread only\fR為何值.此列表可以用@group形式描述組名. 注意如果一個使用者同時屬於讀列表和寫列表則擁有寫入權. 參見 \fIread list \fR 選項。 預設設定: \fBwrite list = <空字串>\fR 示例: \fBwrite list = admin, root, @staff\fR .TP write ok (S) 注意它與 \fIread only\fR 反義. .TP write raw (G) 此選項規定伺服器是否在從客戶端傳輸資料時支援原始方式寫SMB訊息塊.你不應該更改它. 預設設定: \fBwrite raw = yes\fR .TP wtmp directory (G) This parameter is only available if Samba has been configured and compiled with the option \fB --with-utmp\fR\&. It specifies a directory pathname that is used to store the wtmp or wtmpx files (depending on the UNIX system) that record user connections to a Samba server\&. The difference with the utmp directory is the fact that user info is kept after a user has logged out\&. 參見 \fIutmp\fR 選項。 By default this is not set, meaning the system will use whatever utmp file the native system is set to use (usually \fI/var/run/wtmp\fR on Linux)\&. 預設設定: \fBno wtmp directory\fR 示例: \fBwtmp directory = /var/log/wtmp\fR .SH "警告 WARNINGS" .PP 雖然配置檔案允許服務項名包含空格,但你的客戶端軟體就不一定了.因為在比較中總是忽略空格,所以這不成問題 - 但應該認識到其它可能性. .PP 有一條類似提示,很多客戶特別是DOS客戶,會限制服務項名為8個字元.雖然 \fBsmbd\fR(8)沒有這樣的限制,但如果這樣的客戶截去部分服務項名的話,他們的連線嘗試會失敗.為此你可能要保持你的服務項名在8個字元以內. .PP 對於管理員來說[homes] 和 [printers]特殊段的使用很容易,但對預設屬性的多樣組合應該小心.當設計這些段時要特別仔細.特別是要確保假離線目錄許可權的正確性. .SH "版本 VERSION" .PP 此手冊頁是針對samba套件版本3.0的。 .SH "參見 SEE ALSO" .PP \fBsamba\fR(7), \fBsmbpasswd\fR(8), \fBswat\fR(8), \fBsmbd\fR(8), \fBnmbd\fR(8), \fBsmbclient\fR(1), \fBnmblookup\fR(1), \fBtestparm\fR(1), \fBtestprns\fR(1). .SH "作者 AUTHOR" .PP samba軟體和相關工具最初由Andrew Tridgell建立。samba現在由Samba Team 作為開源軟體來發展,類似linux核心的開發方式。 .PP 最初的samba手冊頁是 Karl Auer寫的。 手冊頁原始碼已經轉換為YODL格式(另一種很好的開源軟體,可以在ftp://ftp.ice.rug.nl/pub/unix找到),由Jeremy Sllison 更新到Samba2.0 版本。 Gerald Carter 在Samba2.2中將它轉化為DocBook 格式。 Alexander Bokovoy 在Samba 3.0中實現了DocBook XML4.2 格式的轉換。 .SH "[中文版維護人]" .B meaculpa .SH "[中文版最新更新]" .B 2000/12/08 .SH "《中國linux論壇man手冊頁翻譯計劃》:" .BI http://cmpp.linuxforum.net .Sh "跋" .br 本頁面中文版由中文 man 手冊頁計劃提供。 .br 中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR