Agenda : 1. 2. 3. Instalasi paket SAMBA Konfigurasi SAMBA Tes sharing dari MS Windows PC
SAMBA Server
Konektivitas dengan Windows
Jika dalam satu jaringan ada berbagai macam sistem dengan berbagai macam platform, maka dibutuhkan sebuah program yang menjembatani sehingga semua mesin dapat saling berhubungan satu sama lain. Salah satu program yang menjembatani Linux (dan UNIX pada umumnya) dengan mesin Windows yang cukup terkenal adalah Samba. Samba merupakan aplikasi Unix yang memanfaatkan protokol SMB (Server Message Block). Sebagian sistem operasi memanfaatkan SMB dalam komunikasi clientservernya, termasuk Windows dan OS/2. Samba memungkinkan mesin Linux berkomunikasi dengan mesin Windows/Dos atau OS/2. Dengan Samba Anda dapat menggunakannya untuk : Menghubungkan setiap mesin Unix (termasuk Linux) dengan mesin Dos/Windows Menempatkan mesin Unix (Linux) sebagai Primary Domain Controller sebagaimana yang dilakukan Windows NT/2000. Oleh sebab itu lewat Samba, Anda dapat membuat server dengan klien produk Microsoft Windows, dengan layanan : 1. Berbagi (share) file dan printer. 2. Membantu pengguna browsing di network neighborhood 3. Memberikan otentikasi kepada tiap klien yang login ke dalam domain 4. Memberikan atau membantu dengan WINS name server resolution.
Samba dibuat dan disusun pertama kali oleh ANDREW TRIDGELL. Pada bulan Desember 1991 Ia menerima program eXcursion dari Digital. Sayangnya program tersebut hanya bekerja dengan 'pathworks' ke mesin VMS atau ultrix, yang memaksanya untuk mempelajari bagaimana file dikomunikasikan. Setelah sekian lama mencoba, akhirnya Ia berhasil memasukkan salah satu direktori dari mesin Digital ke dalam 'pathworks' DOS di rumahnya. Setahun kemudian Andrew telah memasuki komunitas Linux (atas ajakan DAN SHEARER), dan pada Desember 1993 Ia mengeluarkan "NetBIOS for Unix". Dengan menggunakan mailing list, program ini dikembangkan bersamasama hingga menjadi Samba Team sebagaimana sekarang. Saat ini Samba dikembangkan sebagai bagian dari Open Source Software (Software yang memberikan kode sumbernya) dan didistribusikan dibawah lisensi GNU GPL. Proyek pengembangannya masih tetap berjalan hingga sekarang dikoordinasikan oleh ANDREW TRIDGELL dari rumahnya di Canberra dengan tim tersebar di seluruh dunia. Catatan : Protokol adalah bahasa standar yang dipergunakan komputer untuk dapat berkomunikasi satu sama lain.Aplikasi Samba biasanya dijalankan sebagai daemon. Dua aplikasi utamanya adalah : smbd Daemon yang memberikan layanan berbagi file dan printer dalam sebuah jaringan yang menggunakan protokol SMB. Smbd juga memberikan otentikasi dan otorisasi bagi kliennya. nmbd Daemon yang memanfaatkan Windows Internet Name Service (WINS), dan membantu klien untuk browsing di network neighborhood.
secara broadcast (kepada seluruh komputer yang ada dalam jaringan) dan mendeklarasikan dirinya dengan nama dari NetBIOS. Proses ini dinamakan name registration. Jika tidak ada bentrok dengan mesin yang lain, maka nama tersebut dipergunakan. Nama inilah yang muncul pada saat user browsing di network neighborhood. WINS adalah penerapan NBNS oleh Microsoft. Jika dalam domain ada server WINS, maka komputer tersebut tidak mengirimkan atau menerima sinyal secara broadcast, melainkan mendaftarkan nama NetBIOSnya ke server WINS. Server ini akan menyimpan nama semua mesin yang telah mendaftarkan mesinnya, dan membantu user saat browsing di network neighborhood. Master Browser Jika Anda memakai Windows 95/98, dan membuka network neighborhood, maka di situ terlihat daftar nama komputer, dan beberapa direktori yang dishare. Daftar ini dibuat dan dipelihara oleh master browser. Sebagaimana yang telah dipelajari sebelumnya, saat komputer dinyalakan, maka akan mengirimkan pesan secara broadcast ke dalam jaringan. Saat itulah, akan terjadi pemilihan komputer mana yang akan menjadi master bowser. Pemilihan ini disebut browsing election.
Istheinformationcorrect?[Y/n]y
2. Setelah user dibuat (exp:dosen), berikutnya adalah mensetting agar user dosen tersebut dapat digunakan di dalam aplikasi sharing di windows, Jika meminta password isikan passwordnya sesuai dengan password sewaktu membuat user tersebut. amikom@amikom:~$sudosmbpasswdadosen
NewSMBpassword: RetypenewSMBpassword: Addeduserdosen.
5. Lakukan backup file smb.conf (agar jika sewaktu-waktu salah konfigurasi dapat tertanggulangi) menjadi smb.conf.original
amikom@amikom:~$sudocp/etc/samba/smb.confetc/samba/smb.conf.original
# #SampleconfigurationfilefortheSambasuiteforDebianGNU/Linux. # # #ThisisthemainSambaconfigurationfile.Youshouldreadthe #smb.conf(5)manualpageinordertounderstandtheoptionslisted #here.Sambahasahugenumberofconfigurableoptionsmostofwhich #arenotshowninthisexample # #Someoptionsthatareoftenworthtuninghavebeenincludedas #commentedoutexamplesinthisfile. #Whensuchoptionsarecommentedwith";",theproposedsetting #differsfromthedefaultSambabehaviour #Whencommentedwith"#",theproposedsettingisthedefault #behaviourofSambabuttheoptionisconsideredimportant #enoughtobementionedhere # #NOTE:Wheneveryoumodifythisfileyoushouldrunthecommand #"testparm"tocheckthatyouhavenotmadeanybasicsyntactic #errors. #Awellestablishedpracticeistonametheoriginalfile #"smb.conf.master"andcreatethe"real"configfilewith #testparmssmb.conf.master>smb.conf #Thisminimizesthesizeofthereallyusedsmb.conffile #which,accordingtotheSambaTeam,impactsperformance #However,usethiswithcautionifyoursmb.conffilecontainsnested #"include"statements.SeeDebianbug#483187foracase #whereusingamasterfileisnotagoodidea. # #=======================GlobalSettings======================= [global] ##Browsing/Identification### #Changethistotheworkgroup/NTdomainnameyourSambaserverwill partof workgroup=labsojak #serverstringistheequivalentoftheNTDescriptionfield serverstring=PC99 #WindowsInternetNameServingSupportSection: #WINSSupportTellstheNMBDcomponentofSambatoenableitsWINS Server #winssupport=no #WINSServerTellstheNMBDcomponentsofSambatobeaWINSClient #Note:SambacanbeeitheraWINSServer,oraWINSClient,butNOT both ;winsserver=w.x.y.z #ThiswillpreventnmbdtosearchforNetBIOSnamesthroughDNS. dnsproxy=no #Whatnamingserviceandinwhatordershouldweusetoresolvehost names #toIPaddresses ;nameresolveorder=lmhostshostwinsbcast ####Networking#### #Thespecificsetofinterfaces/networkstobindto #ThiscanbeeithertheinterfacenameoranIPaddress/netmask;
mail to : mas.ully@gmail.com phone : +6287883131425
#interfacenamesarenormallypreferred interfaces=127.0.0.0/8192.168.7.0/24eth0 #Onlybindtothenamedinterfacesand/ornetworks;youmustusethe #'interfaces'optionabovetousethis. #ItisrecommendedthatyouenablethisfeatureifyourSambamachineis #notprotectedbyafirewallorisafirewallitself.However,this #optioncannothandledynamicornonbroadcastinterfacescorrectly. ;bindinterfacesonly=yes ####Debugging/Accounting#### #ThistellsSambatouseaseparatelogfileforeachmachine #thatconnects logfile=/var/log/samba/log.%m #Capthesizeoftheindividuallogfiles(inKiB). maxlogsize=1000 #IfyouwantSambatoonlylogthroughsyslogthensetthefollowing #parameterto'yes'. #syslogonly=no #WewantSambatologaminimumamountofinformationtosyslog.Everything #shouldgoto/var/log/samba/log.{smbd,nmbd}instead.Ifyouwanttolog #throughsyslogyoushouldsetthefollowingparametertosomethinghigher. syslog=0 #DosomethingsensiblewhenSambacrashes:mailtheadminabacktrace panicaction=/usr/share/samba/panicaction%d #######Authentication####### #"security=user"isalwaysagoodidea.ThiswillrequireaUnixaccount #inthisserverforeveryuseraccessingtheserver.See #/usr/share/doc/sambadoc/htmldocs/Samba3HOWTO/ServerType.html #inthesambadocpackagefordetails. security=share #Youmaywishtousepasswordencryption.Seethesectionon #'encryptpasswords'inthesmb.conf(5)manpagebeforeenabling. ; encryptpasswords=yes #Ifyouareusingencryptedpasswords,Sambawillneedtoknowwhat #passworddatabasetypeyouareusing. ; passdbbackend=tdbsam obeypamrestrictions=yes #ThisbooleanparametercontrolswhetherSambaattemptstosynctheUnix #passwordwiththeSMBpasswordwhentheencryptedSMBpasswordinthe #passdbischanged. unixpasswordsync=yes #ForUnixpasswordsynctoworkonaDebianGNU/Linuxsystem,thefollowing #parametersmustbeset(thankstoIanKahan<<kahan@informatik.tu muenchen.de>for #sendingthecorrectchatscriptforthepasswdprograminDebianSarge). passwdprogram=/usr/bin/passwd%u passwdchat=*Enter\snew\s*\spassword:*%n\n*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully*. #ThisbooleancontrolswhetherPAMwillbeusedforpasswordchanges #whenrequestedbyanSMBclientinsteadoftheprogramlistedin #'passwdprogram'.Thedefaultis'no'. pampasswordchange=yes
mail to : mas.ully@gmail.com phone : +6287883131425
#Thisoptioncontrolshowunsuccessfulauthenticationattemptsaremapped #toanonymousconnections maptoguest=baduser ##########Domains########### #Isthismachineabletoauthenticateusers.BothPDCandBDC #musthavethissettingenabled.IfyouaretheBDCyoumust #changethe'domainmaster'settingtono # ;domainlogons=yes # #Thefollowingsettingonlytakeseffectif'domainlogons'isset #Itspecifiesthelocationoftheuser'sprofiledirectory #fromtheclientpointofview) #Thefollowingrequireda[profiles]sharetobesetuponthe #sambaserver(seebelow) ;logonpath=\\%N\profiles\%U #Anothercommonchoiceisstoringtheprofileintheuser'shomedirectory #(thisisSamba'sdefault) #logonpath=\\%N\%U\profile #Thefollowingsettingonlytakeseffectif'domainlogons'isset #Itspecifiesthelocationofauser'shomedirectory(fromtheclient #pointofview) ;logondrive=H: #logonhome=\\%N\%U #Thefollowingsettingonlytakeseffectif'domainlogons'isset #Itspecifiesthescripttorunduringlogon.Thescriptmustbestored #inthe[netlogon]share #NOTE:Mustbestorein'DOS'fileformatconvention ;logonscript=logon.cmd #ThisallowsUnixuserstobecreatedonthedomaincontrollerviatheSAMR #RPCpipe.TheexamplecommandcreatesauseraccountwithadisabledUnix #password;pleaseadapttoyourneeds ;adduserscript=/usr/sbin/adduserquietdisabledpasswordgecos"" %u #Thisallowsmachineaccountstobecreatedonthedomaincontrollervia the #SAMRRPCpipe. #Thefollowingassumesa"machines"groupexistsonthesystem ;addmachinescript=/usr/sbin/useraddgmachinesc"%umachineaccount" d/var/lib/samba s/bin/false %u #ThisallowsUnixgroupstobecreatedonthedomaincontrollerviathe SAMR #RPCpipe. ;addgroupscript=/usr/sbin/addgroupforcebadname%g ##########Printing########## #Ifyouwanttoautomaticallyloadyourprinterlistrather #thansettingthemupindividuallythenyou'llneedthis #loadprinters=yes #lpr(ng)printing.Youmaywishtooverridethelocationofthe #printcapfile ;printing=bsd ;printcapname=/etc/printcap #CUPSprinting.Seealsothecupsaddsmb(8)manpageinthe
mail to : mas.ully@gmail.com phone : +6287883131425
#cupsysclientpackage. ; printing=cups ;printcapname=cups ############Misc############ #Usingthefollowinglineenablesyoutocustomiseyourconfiguration #onapermachinebasis.The%mgetsreplacedwiththenetbiosname #ofthemachinethatisconnecting ;include=/home/samba/etc/smb.conf.%m #Mostpeoplewillfindthatthisoptiongivesbetterperformance. #Seesmb.conf(5)and/usr/share/doc/sambadoc/htmldocs/Samba3 HOWTO/speed.html #fordetails #YoumaywanttoaddthefollowingonaLinuxsystem: # SO_RCVBUF=8192SO_SNDBUF=8192 #socketoptions=TCP_NODELAY #Thefollowingparameterisusefulonlyifyouhavethelinpopuppackage #installed.Thesambamaintainerandthelinpopupmaintainerare #workingtoeaseinstallationandconfigurationoflinpopupandsamba. ;messagecommand=/bin/shc'/usr/bin/linpopup"%f""%m"%s;rm%s'& #DomainMasterspecifiesSambatobetheDomainMasterBrowser.Ifthis #machinewillbeconfiguredasaBDC(asecondarylogonserver),you #mustsetthisto'no';otherwise,thedefaultbehaviorisrecommended. #domainmaster=auto #Somedefaultsforwinbind(makesureyou'renotusingtheranges #forsomethingelse.) ;idmapuid=1000020000 ;idmapgid=1000020000 ;templateshell=/bin/bash #Thefollowingwasthedefaultbehaviourinsarge, #butsambaupstreamrevertedthedefaultbecauseitmightinduce #performanceissuesinlargeorganizations. #SeeDebianbug#368251forsomeoftheconsequencesof*not* #havingthissettingandsmb.conf(5)fordetails. ;winbindenumgroups=yes ;winbindenumusers=yes #Setupusershareoptionstoenablenonrootuserstosharefolders #withthenetusersharecommand. #Maximumnumberofusershare.0(default)meansthatusershareisdisabled. ; usersharemaxshares=100 #Allowuserswho'vebeengrantedusershareprivilegestocreate #publicshares,notjustauthenticatedones usershareallowguests=yes guestok=yes guestaccount=amikom #=======================ShareDefinitions======================= #Uncommentthefollowing(andtweaktheothersettingsbelowtosuit) #toenablethedefaulthomedirectoryshares.Thiswillshareeach #user'shomedirectoryas\\server\username [homes] comment=HomeDirectories ;browseable=yes
mail to : mas.ully@gmail.com phone : +6287883131425
#Bydefault,thehomedirectoriesareexportedreadonly.Changethe #nextparameterto'no'ifyouwanttobeabletowritetothem. ;readonly=yes #Filecreationmaskissetto0700forsecurityreasons.Ifyouwantto #createfileswithgroup=rwpermissions,setnextparameterto0775. ;createmask=0700 #Directorycreationmaskissetto0700forsecurityreasons.Ifyouwant to #createdirs.withgroup=rwpermissions,setnextparameterto0775. ;directorymask=0700 #Bydefault,\\server\usernamesharescanbeconnectedtobyanyone #withaccesstothesambaserver.Uncommentthefollowingparameter #tomakesurethatonly"username"canconnectto\\server\username #Thismightneedtweakingwhenusingexternalauthenticationschemes ;validusers=%S #UncommentthefollowingandcreatethenetlogondirectoryforDomain Logons #(youneedtoconfigureSambatoactasadomaincontrollertoo.) ;[netlogon] ;comment=NetworkLogonService ;path=/home/samba/netlogon ;guestok=yes ;readonly=yes ;sharemodes=no #Uncommentthefollowingandcreatetheprofilesdirectorytostore #usersprofiles(seethe"logonpath"optionabove) #(youneedtoconfigureSambatoactasadomaincontrollertoo.) #Thepathbelowshouldbewritablebyalluserssothattheir #profiledirectorymaybecreatedthefirsttimetheylogon ;[profiles] ;comment=Usersprofiles ;path=/home/samba/profiles ;guestok=no ;browseable=no ;createmask=0600 ;directorymask=0700 [printers] ; ; comment=AllPrinters browseable=no path=/var/spool/samba printable=yes guestok=no readonly=yes createmask=0700 #Windowsclientslookforthissharenameasasourceofdownloadable #printerdrivers [print$] comment=PrinterDrivers path=/var/lib/samba/printers ;browseable=yes ;readonly=yes ;guestok=no
mail to : mas.ully@gmail.com phone : +6287883131425
#UncommenttoallowremoteadministrationofWindowsprintdrivers. #Youmayneedtoreplace'lpadmin'withthenameofthegroupyour #adminusersaremembersof. #PleasenotethatyoualsoneedtosetappropriateUnixpermissions #tothedriversdirectoryfortheseuserstohavewriterightsinit ;writelist=root,@lpadmin #AsampleshareforsharingyourCDROMwithothers. ;[cdrom] ;comment=Sambaserver'sCDROM ;readonly=yes ;locking=no ;path=/cdrom ;guestok=yes #ThenexttwoparametersshowhowtoautomountaCDROMwhenthe #cdromshareisaccesed.Forthistowork/etc/fstabmustcontain #anentrylikethis: # #/dev/scd0/cdromiso9660defaults,noauto,ro,user00 # #TheCDROMgetsunmountedautomaticallyaftertheconnectiontothe # #Ifyoudon'twanttouseautomounting/unmountingmakesuretheCD #ismountedon/cdrom # ;preexec=/bin/mount/cdrom ;postexec=/bin/umount/cdrom [DATAPC99] path=/home/norman writeable=yes browseable=yes guestok=yes [Documents] path=/home/amikom/Documents writeable=yes ;browseable=yes guestok=yes
7. Langkah terakhir adalah menjalankan samba tersebut. amikom@amikom:~$sudo/etc/init.d/smbdstart 8. Dari Windows Network, cek di Windows Networking apakah Samba Server sdh bisa...