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

67 FreeBSD連載:配置samba

配置samba雖然缺省情況已經(jīng)適合大部分用戶(hù)訪問(wèn)自己在服務(wù)器上的個(gè)人目錄的要求,但是為了充分發(fā)揮samba提供的功能,與這些復(fù)雜多樣的Windows網(wǎng)絡(luò)相適應(yīng),就必須更改smb.conf的設(shè)置 。以提供更多的共享設(shè)置、服務(wù)器設(shè)置,以及用于支持包括比較簡(jiǎn)單的共享方式和復(fù)雜的域認(rèn)證方式在內(nèi)的認(rèn)證方式 。
smb.conf中的語(yǔ)法非常簡(jiǎn)單,整個(gè)配置文件分為多個(gè)不同的部分,每個(gè)部分具有一個(gè)標(biāo)題 。使用方括號(hào)將標(biāo)題引起來(lái),標(biāo)題下包括一些相關(guān)設(shè)置,每一行都用于一個(gè)相關(guān)設(shè)置 。設(shè)置文件中的每個(gè)部分或者定義了一個(gè)共享資源的名字,或者設(shè)置了一組參數(shù) 。以下以缺省smb.conf為例,介紹smb.conf中的相關(guān)設(shè)置 。
[global]設(shè)置
# This is the main Samba configuration file. You should read the# smb.conf(5) manual page in order to understand the options listed# here. Samba has a huge number of configurable options (perhaps too# many!) most of which are not shown in this example## Any line which starts with a ; (semi-colon) or a # (hash)# is a comment and is ignored. In this example we will use a ## for commentry and a ; for parts of the config file that you# may wish to enable## NOTE: Whenever you modify this file you should run the command "testparm"# to check that you have not many any basic syntactic errors.##======================= Global Settings =====================================[global][global]部分定義了服務(wù)器本身使用的配置參數(shù),以及其他共享資源部分使用的缺省配置參數(shù),因此相當(dāng)重要 。
# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4workgroup = MYGROUP工作組設(shè)置本地網(wǎng)絡(luò)使用工作組名字(或者是NT域名字),這對(duì)于將正確進(jìn)行瀏覽數(shù)據(jù)中非常重要 。否則,Windows客戶(hù)就不能從其網(wǎng)絡(luò)鄰居中發(fā)現(xiàn)這個(gè)Samba服務(wù)器 。
# server string is the equivalent of the NT Description fIEldserver string = Samba Serverserver string是對(duì)于本地服務(wù)器的簡(jiǎn)單描述,這些信息將作為這臺(tái)服務(wù)器的屬性,返回給Browser,顯示在Windows客戶(hù)中作為對(duì)這個(gè)服務(wù)器的描述 。
# This option is important for security. It allows you to restrict# connections to Machines which are on your local network. The# following example restricts access to two C class networks and# the "loopback" interface. For more examples of the syntax see# the smb.conf man page;hosts allow = 192.168.1. 192.168.2. 127.hosts allow參數(shù)用于限制可以訪問(wèn)這臺(tái)samba服務(wù)器的客戶(hù)機(jī)的IP地址范圍,通過(guò)指定一系列網(wǎng)絡(luò)地址,使得只有這些網(wǎng)絡(luò)中的計(jì)算機(jī)才能訪問(wèn)這臺(tái)服務(wù)器提供的資源,以提供安全限制 。缺省情況下,這行配置被注釋了,使得所有的客戶(hù)都可以訪問(wèn)這臺(tái)計(jì)算機(jī),這樣就存在一定的安全問(wèn)題 。
# If you want to automatically load your printer list rather# than setting them up individually then you"ll need thisload printers = yes # you may wish to override the location of the printcap file;printcap name = /etc/printcap # on SystemV system setting printcap name to lpstat should allow# you to automatically obtain a printer list from the SystemV spool# system;printcap name = lpstat # It should not be necessary to specify the print system type unless# it is non-standard. Currently supported print systems include:# bsd, sysv, plp, lprng, AIX, hpux, qnx;printing = bsd這些設(shè)置是用于設(shè)置samba服務(wù)器的打印機(jī)資源,load printer=yes就允許samba服務(wù)器對(duì)外共享服務(wù)器的打印機(jī) 。由于不同的Unix系統(tǒng)中會(huì)使用不同的打印系統(tǒng)和不同的打印設(shè)置文件,因此需要設(shè)置正確的printcap和printing類(lèi)型,對(duì)于使用BSD打印系統(tǒng)的FreeBSD來(lái)講,打印系統(tǒng)為BSD,使用的設(shè)置文件為printcap,這些是缺省設(shè)置,不需要改動(dòng) 。對(duì)于使用Unix System V打印系統(tǒng)的Samba,則需要重新進(jìn)行設(shè)置 。
# Uncomment this if you want a guest account, you must add this to /etc/passwd# otherwise the user "nobody" is used;guest account = pcguest由于Mircrosoft客戶(hù)沒(méi)有用戶(hù)的概念,因此有時(shí)會(huì)用沒(méi)有用戶(hù)和口令的請(qǐng)求訪問(wèn)服務(wù)器,就需要將這個(gè)沒(méi)有用戶(hù)的請(qǐng)求映射為系統(tǒng)中的某個(gè)用戶(hù),Samba服務(wù)器才能安全的訪問(wèn)系統(tǒng) 。guest account就定義這樣的請(qǐng)求在Unix下對(duì)應(yīng)的用戶(hù)權(quán)限 。為了安全的原因,不能讓這個(gè)帳戶(hù)在系統(tǒng)中有可寫(xiě)的權(quán)限,通常可以增加一個(gè)專(zhuān)用帳戶(hù),如pcguest 。如果這個(gè)設(shè)置被注釋的情況下,系統(tǒng)缺省使用nobody執(zhí)行Windows客戶(hù)的請(qǐng)求 。一些使用者建議不要使用nobody用戶(hù),因?yàn)橄到y(tǒng)中的很多程序缺省都使用它,因此就會(huì)有安全問(wèn)題 。

推薦閱讀