Samba NT Domain Controller_unix linux教程-查字典教程网
Samba NT Domain Controller
Samba NT Domain Controller
发布时间:2016-12-26 来源:查字典编辑
摘要:Currently,SambacangobeyondmerelyemulatingWindowssharestoactuallyacting...

Currently,SambacangobeyondmerelyemulatingWindowssharestoactuallyactingasthePrimaryDomainControllerforyourWindowsnetwork.Ofcourse,SambacanalsobecomeaNTdomainmember.Inthisarticleweshalllookatboththeseoptions.

Thedomainconceptismuchbetterthanthetraditionalworkgroupconcept.OneoftheprimarybenefitsishavingacentralizedpassworddatabaseonthePrimaryDomainController.Onceauthenticated,youcanaccessanyofthesharesinthedomain,withouthavingtore-authenticateyourself.

Ifyou'reunfamiliarwithSamba,thenwe'vegotacoupleofgoodhowto'sthatyoucanreferto.Lookforlinkstothematthebottomofthearticle.

SambaasaNTDomainMember

SambaemulatesaNTworkstationwhenbecomingpartofthedomain.So,thefirstthingyouneedtodoiscreateamachineaccountforyourSambamachineonthedomaincontroller.InNTyouwouldusetheprogramServerManagerforDomainstocreatetheaccount.Oncetheaccountiscreated,allyouneedtoaddarethefollowinglinestoyoursmb.conffileundertheglobalsection.

#YourWorkgrouporDomainthatyouwant

#tologinto

workgroup=FREEOS

#TellSambatotalktodomaincontroller

#forauthentication

security=domain

#Specifytheservertogetauthenticate

#from.Youcanspecifythe

#NetBIOS#namesoftheserversorsimply

#putina"*"heretolet

#Sambafindtheserverthroughbroadcast

passwordserver=PS1PS2

#MakesureSambaisusingencrypted

#passwords

encryptpasswords=yes

NowstoptheSambadaemons

/etc/rc.d/init.d/smbstop

Givethefollowingcommandtojointhe

NTDomain

smbpasswd-jDOMAIN-rDOMAINPDC

DOMAINhereisthedomainthatyouwanttologonto.DOMAINPDCistheprimarydomaincontrollerforthatdomain.Youwillthenseeamessagesaying,揓oineddomainDOMAIN?

NowstartyourSMBandNMBdaemons.

/etc/rc.d/init.d/smbstart

ThatwasallaboutjoininganNTdomain.SettingupSambaasyourPrimaryDomainControllerisnotverydifficult.

SambaasPrimaryDomainController

Addthefollowingtotheglobalsectionofyoursmb.conffile.

#ThedomainyouwanttobeaPDCfor

workgroup=SIMPLE

#TellSambatousedomainlogons

domainlogons=yes

#User-levelsecurity.Usersmust

#authenticatethemselveswith

#validusernameandpassword

security=user

#Settoyessothatnmbdparticipates

#inlocalmasterbrowser

#elections

localmaster=yes

#SetOslevelvaluetomakesurenmbd

#winslocalbrowsemaster

#elections.65shouldbeateveryone

#accordingtothemanpage

oslevel=65

#Givenmbdanadvantageinlocal

#masterbrowserelections

preferredmaster=yes

#Setsothatnmbdclaimsaunique

#NetBIOSnameidentifyingitas

#adomainmaster

domainmaster=yes

#Thefollowingshareisrequiredtosupport

#domainlogons.Thedirectorymaybe

#createdanywhereonyoursystem.Make

#suretheshareisnon-writeableandalso

#notapublicshare.

[netlogon]

comment=Thedomainlogonservice

path=/usr/local/samba/netlogon

public=no

writeable=no

ThenextthingtodoiscreatetheusersontheSambaserverthatistoactasthedomaincontroller.Youcandothisusingtheuseraddcommand.

useradd?gsmbuser?d/dev/null?s/dev/nullntuser

Asyoucansee,bothshellandhomedirectoryforntuserissetto/dev/null.IfyourWindowsusersarenotrequiredtoaccesstheUnixbox,youshouldusetheabovetodenyaccesstothemachine.PasswordsarealsonotrequiredtobesetbecauseSambakeepsthepasswordhashinaseparatefilespecifiedintheconfigurationfile.

#PathtoSambapasswordfile

#Makesureonlyroothasread/writeaccess

smbpasswdfile=/usr/local/samba/smbpasswd

Afteraddingauser(youcanalsousevipwtoaddauser),youneedtoaddtheusertothesambapassworddatabase.

搒mbpasswd朼?willaddallusersinUnixpasswdfiletosmbpasswdfile.TheusageandsyntaxissimilartotheUnixpasswdcommand.Tochangeausers?passworduse搒mbpasswdusername?

ThatwillbeenoughforSambatostartauthenticatingWindows9Xclients.ForNTworkstations,somemoreworkistobedone.YouhavetocreateamachineaccountforeachNTclientthatwilllogon.Amachineaccountissimplyaregular/etc/passwdentry,witha??appendedtothenameoftheNTmachine.

useradd-gsmbuser-杁/dev/null-杝/dev/nullntclient$

Nowaddittothepassworddatabase

smbpasswd朼杕ntclient(the$attheendisnotrequired)

SambacannowacceptlogonsfromaNTclient.

Asyoucansee,configuringsambaasadomaincontrolleranddomainmemberisafairlyeasyjob.Theflipsideisthatsincesambaistheresultofmajoramountsofhackingandreverseengineering,itdoesn'thaveallthefunctionalityofaproperdomaincontroller.Thereisanalternativebranch,SambaTNGthataddsmorefunctionalityinthisarea.

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新unix linux学习
    热门unix linux学习
    操作系统子分类