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

67 FreeBSD連載:配置samba( 五 )


其他專有共享目錄
# This one is useful for people to share files;[tmp];comment = Temporary file space;path = /tmp;read only = no;public = yes # A publicly accessible directory, but read only, except for people in# the "staff" group;[public];comment = Public Stuff;path = /home/samba;public = yes;writable = yes;printable = no;write list = @staff # Other examples.## A private printer, usable only by fred. Spool data will be placed in fred"s# home directory. Note that fred must have write access to the spool directory,# wherever it is.;[fredsprn];comment = Fred"s Printer;valid users = fred;path = /homes/fred;printer = freds_printer;public = no;writable = no;printable = yes # A private directory, usable only by fred. Note that fred requires write# access to the directory.;[fredsdir];comment = Fred"s Service;path = /usr/somewhere/private;valid users = fred;public = no;writable = yes;printable = no # a service which has a different directory for each machine that connects# this allows you to tailor configurations to incoming machines. You could# also use the \u option to tailor it by user name.# The %m gets replaced with the machine name that is connecting.;[pchome];comment = PC Directories;path = /usr/pc/%m;public = no;writable = yes # A publicly accessible directory, read/write to all users. Note that all files# created in the directory by users will be owned by the default user, so# any user with access can delete any other user"s files. Obviously this# directory must be writable by the default user. Another user could of course# be specified, in which case all files would be owned by that user instead.;[public];path = /usr/somewhere/else/public;public = yes;only guest = yes;writable = yes;printable = no # The following two entries demonstrate how to share a directory so that two# users can place files there that will be owned by the specific users. In this# setup, the directory should be writable by both users and should have the# sticky bit set on it to prevent abuse. Obviously this could be extended to# as many users as required.;[myshare];comment = Mary"s and Fred"s stuff;path = /usr/somewhere/shared;valid users = mary fred;public = no;writable = yes;printable = no;create mask = 0765此后,缺省smb.conf中給出了一些設(shè)定各種共享文件資源、打印機資源的例子,例如設(shè)置特定打印機的[fredprn],設(shè)置私人文件共享資源的[freddir]和[myshare],使用宏為多個用戶設(shè)置共享的[pchome],提供公共訪問的[public]和[tmp],F(xiàn)reeBSD的管理員可以根據(jù)具體情況,根據(jù)這些設(shè)置例子設(shè)置相應(yīng)的共享資源,并設(shè)置相應(yīng)的訪問權(quán)限,以保護(hù)文件系統(tǒng)不被非法訪問 。
需要注意的是,當(dāng)使用valid user用來設(shè)置合法訪問用戶時,或者使用wirte list定義具備寫權(quán)限的用戶時,都可以使用@staff的形式使用Unix的組名,這樣凡是屬于該staff組成員的用戶,都會具備相應(yīng)權(quán)限 。
從這些例子中可以看到[global]用于設(shè)定全局參數(shù),不會出現(xiàn)在資源列表中,[homes]用于設(shè)定個人目錄共享,其共享的名字映射為個人標(biāo)識符而非homes,[printers]設(shè)定打印機共享,將共享所有的打印機名字,除了這些標(biāo)題的共享名字與標(biāo)題不同之外,其他每個標(biāo)題都將代表一個共享資源的名字 。
當(dāng)更改設(shè)置之后,可以重新啟動Samba服務(wù)器,提供新的共享服務(wù)了 。但在重新啟動服務(wù)器之前,最好使用Samba軟件包中提供的測試軟件,檢查一下設(shè)置是否正確 。這些小工具程序包括檢查smb.conf設(shè)置的testparm,檢查打印機名字的正確性的程序testprn,用于進(jìn)行NetBIOS名字解析的nmblookup等 。
使用swat配置samba
samba 2.0提供了一個能夠通過瀏覽器來配置samba的工具──swat 。它是一個專用www服務(wù)器,使用inetd來啟動,然后經(jīng)過認(rèn)證,可以允許用戶通過瀏覽器來配置smb.conf 。為了達(dá)到這個目的,首先要為swat分配一個固定的端口,這個工作可以通過在/etc/services中增加一行來完成:

推薦閱讀