GentooIntroduction to Samba Part 2.docx

上传人:b****8 文档编号:12542878 上传时间:2023-06-06 格式:DOCX 页数:11 大小:20.92KB
下载 相关 举报
GentooIntroduction to Samba Part 2.docx_第1页
第1页 / 共11页
GentooIntroduction to Samba Part 2.docx_第2页
第2页 / 共11页
GentooIntroduction to Samba Part 2.docx_第3页
第3页 / 共11页
GentooIntroduction to Samba Part 2.docx_第4页
第4页 / 共11页
GentooIntroduction to Samba Part 2.docx_第5页
第5页 / 共11页
GentooIntroduction to Samba Part 2.docx_第6页
第6页 / 共11页
GentooIntroduction to Samba Part 2.docx_第7页
第7页 / 共11页
GentooIntroduction to Samba Part 2.docx_第8页
第8页 / 共11页
GentooIntroduction to Samba Part 2.docx_第9页
第9页 / 共11页
GentooIntroduction to Samba Part 2.docx_第10页
第10页 / 共11页
GentooIntroduction to Samba Part 2.docx_第11页
第11页 / 共11页
亲,该文档总共11页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

GentooIntroduction to Samba Part 2.docx

《GentooIntroduction to Samba Part 2.docx》由会员分享,可在线阅读,更多相关《GentooIntroduction to Samba Part 2.docx(11页珍藏版)》请在冰点文库上搜索。

GentooIntroduction to Samba Part 2.docx

GentooIntroductiontoSambaPart2

Disclaimer:

TheoriginalversionofthisarticlewasfirstpublishedonIBMdeveloperWorks,andispropertyofWesttechInformationServices.Thisdocumentisanupdatedversionoftheoriginalarticle,andcontainsvariousimprovementsmadebytheGentooLinuxDocumentationteam.

Thisdocumentisnotactivelymaintained.

IntroductiontoSamba,Part2

1. Compiling,installing,andconfiguringSambaforyourenvironment

DownloadingSamba

OK,it'stimetodownloadSamba2.0.7orgreaterfromtheSamba.orgWebsite(seeResourceslaterinthisarticle).

Note:

WhileI'llbecompilingSambafromscratch,youmaychoosetoinstallSambafromabinarypackage(suchasRPMthatcamewithyourLinuxdistribution).ThisisperfectlyOK.But,asImentionedinmylastarticle,ifyoudothis,yourfilelocationsmaybeslightlydifferentthanwhatIrefertohere.

Afteryou'vedownloadedSamba2.0.7orgreater,it'stimetodecompressittoadirectorylocationofyourchoice.Fromthecommandprompt,type:

CodeListing 1.1:

Unpackingthesourcefiles

$tar-xzvfsamba-2.0.7.tar.gz

Asamba-2.0.7directorywillbecreated.cdintoit,andwe'lltakealookaround.First,noticethedocsdirectory.Insideityou'llseeanotherdirectorycalledtextdocs.texdocscontainsawholebunchofSambadocumentation.OneofthemostimportantfilesinthetextdocsdirectoryiscalledDIAGNOSIS.txt.Itwalksyouthroughastep-by-stepprocessofdiagnosingproblemsyoumayhavewithproperSambaoperation.We'llbecoveringsome,butnotall,ofthediagnosisproceduresmentionedinthisfile.

CompilingandinstallingSamba

You'llalsonoticethesourcesdirectoryinthemainsamba-2.0.7directory.Insidesourcesyou'llfindawelldesignedconfigurescriptdesignedtosetupallthemakefilesproperly.Aswithanyotherconfigurescript,togetalistoftheconfigurationoptions,type:

CodeListing 1.2:

Investigatingoptions

$./configure--help

Youwillprobablywanttopipetheoutputtomoresothatyoucanviewalltheoptions:

CodeListing 1.3:

Evenmoreoptions

$./configure--help|more

Notethedirectoryandfilenameoptions.Noticewhereeverythinggetsinstalled,andthatthedefaultinstallpathis/usr/local/samba.Youwillprobablywanttochangethisto/usr/localbypassingthe--prefix=/usr/localoptionwhenyouconfigureSamba.Forthisexample,I'mgoingtousethefollowingpathsettings:

CodeListing 1.4:

Configuringthedirectoryoptions

$./configure--prefix=/usr/local--localstatedir=/var/log--sysconfdir=/etc

TheaboveconfigurationoptionswillcauseSamba'sdefaulttreetobein/usr/local,withtheexceptionoftheconfigurationfiles.Sambawillexpecttofindthesein/etcandlogfiles,whichwillendupin/var/log.Ifyouomitthoseconfigureoptions,you'llfindeverythinginthe/usr/local/sambadirectorytree(/usr/local/samba/var,/usr/local/samba/etc,etc.).

It'snowtimetostartthecompilation.Afterrunningconfigure,type:

CodeListing 1.5:

CompilingSamba

$make

Aftercompilationcompletes,typethefollowingasroottoinstallthesoftware:

CodeListing 1.6:

InstallingSamba

#makeinstall

Configuringtheserver

Forthemostpart,configuringSambabeginsandendswiththesmb.conffile.ThisisSamba'smainconfigurationfile.Ithasmanydifferentconfigurationoptions.Toavoidconfusion,we'regoingtostartonlywiththoseoptionsessentialtotheproperoperationofSamba.First,you'llneedtofindoutwheresmb.confshouldbe.IfyouusedtheconfigurationoptionsIspecifiedabove,youshouldplacesmb.confin/etc.Ifyouusedthedefaultpaths,Sambawilllookforitin/usr/local/samba/etc.Togetstarted,cdtotheappropriatedirectory,fireupyourfavoritetexteditor,andtypeinthefollowinglines.I'llinterspersecommentaryalongthewaytoprovideyouwithagoodunderstandingofwhateachoptiondoes.Addtheselinestoyoursmb.conffile:

CodeListing 1.7:

smb.conf

[global]

workgroup=YOURWORKGROUP

security=user

encryptpasswords=yes

guestaccount=guest

ThefirstlinetellsSambathatweareplacingoptionsinthe"global"section.Therearemanyoptionsthatareintendedtobedefinedonlyinthissection.TheseoptionscontroltheglobalbehaviorofSamba.

ThesecondlinetellsSambathenameoftheWindowsworkgroupthatSambawillcreate.ReplaceYOURWORKGROUPwithanappropriatenameforyourworkgroup.

Onthethirdline,wetellSambatoruninuser-levelsecuritymode.ThisoptionwillcauseSambatotellallconnectingWindowsclientsthattheyneedtoprovideavalidusername/passwordcombinationtogainaccesstoanynetworkresource.Thisisdefinitelyagoodthing.User-levelsecurityisSamba'smostoftenusedsecuritylevelbecauseit'sanexcellentmatchforthemajorityoffilesharingsituations.However,thereareothersecuritylevelsavailable.OnehandymodetellsSambatoauthenticateallusersagainstthesecuritydatabaseofanexistingWindowsNTor2000Server.Wewon'tbecoveringthatparticularmodeinthisarticle.Ifyouwantmoreinformationaboutit,takealookatthe"security"optioninthesmb.confmainpage.

Now,ontothefourthline.HerewetellSambatoexchangepasswordswithSambainencryptedmode.YouwillalwayswanttorunSambainencryptedmode,unlessallyourclientmachinesareextremelyancient(likeWindowsforWorkgroups-eramachines).EnablingencryptedpasswordsdoescauseSambatoneeditsownpasswordfile,inadditiontothestandardUnixpassworddatabase.Ifyouarethinkingthatitmaybenicetoturnencryptedpasswordsoff,sothatyoucanavoidhavingtomaintaintwopasswordfiles,don'tdoit!

TurningencryptedpasswordsoffwillcausesharingproblemswithevenmoderatelyoldversionsofWindowsNT4.0inadditiontoWindows2000.Ifyoureallywanttoavoidmaintainingtwoseparatedatabases,Sambaprovidesseveralwaystosynchronizebothdatabases,whichisabetterapproach.

ThenextlinespecifiesavalidUnixuseraccountthatwillbeusedforguestaccess.Whilepeopleoftenuse"guestaccount=nobody",it'srecommendedthatyouaddaliteral"guest"usertoyoursystemifonedoesn'texistalready.Thenew"guest"accountdoesnotneedapasswordsetanddoesnotneedtobeabletologininteractively.(It'sfineifyoudochoosetoconfigureguestwithapasswordandavaliddefaultshell.)

Nowwe'rereadytoaddWINSsupportoptionstosmb.conf.You'llwanttoaddoneofthefollowingtwolinestotheglobalsection:

CodeListing 1.8:

WINSsupport

winssupport=yes

OR

CodeListing 1.9:

WINSserverIPaddress

winsserver=IPaddressofWINSserver

IfyoualreadyhaveaWINSserveronyourcurrentsubnet(aWindowsNTServerrunningWINS,forexample),you'llwanttousethesecondoptionandspecifythenameoftheWINSserverontherightsideoftheequalssign.Samba'sinternalWINSserviceswillthenbedisabled,anditwillusetheWINSserveryouspecify.

Ifyoudon'thaveaWINSserverrunningonyoursubnet,oryou'resettingSambaupathomeandyoudon'tknowexactlywhataWINSserveris,you'llwanttousethefirstoption.ThiswilltellSambatobecomeaWINSserverforyourLAN.

YoumaybewonderingwhatWINSdoes.Basically,youcanthinkofWINSasalocaldynamicDNSdatabase.WhenSambaisrunningasaWINSserver,everyWindows-compatiblemachineonthesamesubnetwillregisteritsIPaddressandNetBIOSname(a.k.a."computername")withSamba.ThisenablesWindowsmachinestouseSamba'sWINSdatabasetorequestanIPaddressforaparticularNetBIOSname.WINSisakeycomponentofnetworkbrowsing,whichiswhatyouaredoingwhenyoupokearoundinsidetheNetworkNeighborhoodonaWindowsmachine.

Nowwe'rereadytoaddseveralmoreoptionstotheglobalsection:

CodeListing 1.10:

Networkbrowsingsetup

localmaster=yes

oslevel=99

domainmaster=yes

preferredmaster=yes

Nowforanexplanation.Alltheseoptionsarerelatedtonetworkbrowsing.I'vealreadymentionedthatWINSisakeycomponentofnetworkbrowsing,butthere'sanotherelementrequiredforbrowsingtoworkproperly.Alocalmasterbrowsermustexist.Soundstrange?

Somefurtherexplanationisrequired.

Forbrowsingtoworkproperly,theremustbesomecentrallocationthatkeepstrackofwhatmachinesandworkgroupsexistonthelocalsubnet.Thisparticularlistiscalledthebrowselist.Thebrowselistisusedtoconstructthelistofworkgroups,domains,andmachinesyouseewhenyoufirstclickontheNetworkNeighborhood.AnymodernWindowsmachinecanbecomethelocalmasterbrowser.Ideally,we'dlikeSambatobethelocalmasterbrowseronthenetwork.

Howisthisaccomplished?

Basically,severalbeefyWindows-compatiblemachinesonyoursubnetwillregularlydukeitoutbyflingingpacketsbackandforthacrossyourLANinanattempttodeterminewhowillbecomethelocalmasterbrowser.Thisprocessiscalleda"browserelection."

Note:

Beagoodsport.Pleasedon'tuseSamba'sabilitytobeatWindowsinallbrowserelectionsasanexcusetoteaseMicrosoftadministratorsinyourorganization.Remember,it'simportanttobeagoodwinner.

Intheendthe"winner"ofthisbroadcastpacketwargetstobecomethelocalmasterbrowser.WecancauseSambatowinthebattlebyusingtheoslevel=99option,whichcausesittobeateveryothermachineontheLAN.ThishappensbecauseeveryversionofWindows(fromWindows95toNTto2000)hasahard-codedOSlevelthatwasintendedtocausethemostadvancedversionofWindowstobecomethelocalmasterbrowser(laterversionsofWindowshaveabiggernumber).SettingSambato99willcauseittobeatallMicrosoftproducts,allowingittobecomethelocalmaster

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2