You are on page 1of 4

9/30/2014 50 UNIX / Linux Sysadmin Tutorials

http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials/ 1/11
180 475 Suka
Home
FreeeBook
Contact
About
StartHere
50UNIX/LinuxSysadminTutorials
byRameshNatarajanonDecember25,2010
MerryChristmasandHappyHolidaystoallTGSReaders.
Towrapthisyear,Ivecollected50UNIX/Linuxsysadminrelatedtutorialsthatwevepostedsofar.
Thisislotofreading.Bookmarkthisarticleforyourfuturereferenceandreaditwheneveryougetfree
time.
1. Disktodiskbackupusingddcommand:ddisapowerfulUNIXutility,whichisusedbythe
Linuxkernelmakefilestomakebootimages.Itcanalsobeusedtocopydata.Thisarticle
explainshowtobackupentireharddiskandcreateanimageofaharddiskusingddcommand.
2. 15rsynccommandexamples:Everysysadminshouldmastertheusageofrsync.rsyncutilityis
usedtosynchronizethefilesanddirectoriesfromonelocationtoanother.Firsttime,rsync
replicatesthewholecontentbetweenthesourceanddestinationdirectories.Nexttime,rsync
transfersonlythechangedblocksorbytestothedestinationlocation,whichmakesthetransfer
reallyfast.
3. Threesysadminrules:Ifyouareasysadmin,youcant(andshouldnt)breakthesethreesysadmin
rules.
4. Userandgroupdiskquota:Thisarticleexplainshowtosetupuserandgroupquotewithsoft
limit,hardlimitandgraceperiod.Forexample,ifyouspecify2GBashardlimit,userwillnotbe
abletocreatenewfilesafter2GB.
5. Troubleshootusingdmesg:Usingdmesgyoucanviewbootupmessagesthatdisplays
informationaboutthehardwaredevicesthatthekerneldetectsduringbootprocess.Thiscanbe
helpfulduringtroubleshootingprocess.
6. RPMpackagemanagementexamples:15examplesprovidedinthisarticleexplainseverything
youneedtoknowaboutmanagingRPMpackagesonredhatbasedsystem(includingCentOS).
7. 10netstatexamples:Netstatcommanddisplaysvariousnetworkrelatedinformationsuchas
networkconnections,routingtables,interfacestatistics,masqueradeconnections,multicast
membershipsetc.,
8. Managepackagesusingapt*commands:These13practicalexamplesexplainshowtomanage
packagesusingaptget,aptcache,aptfileanddpkgcommands.
9. Modprobecommandexamples:modprobeutilityisusedtoaddloadablemodulestotheLinux
kernel.Youcanalsoviewandremovemodulesusingmodprobecommand.
10. Ethtoolexamples:Ethtoolutilityisusedtoviewandchangetheethernetdeviceparameters.These
exampleswillexplainhowyoucanmanipulateyourethernetNICcardusingethtool.
9/30/2014 50 UNIX / Linux Sysadmin Tutorials
http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials/ 2/11
11. NFSmountusingexportfs:ThisisalinuxbeginnersguidetoNFSmountusingexportfs.This
explainshowtoexportafilesystemtoaremotemachineandmountitbothtemporarilyand
permanently.
12. Changetimezone:DependingonyourLinuxdistribution,useoneofthemethodsexplainedin
thisarticletochangethetimezoneonyoursystem.
13. InstallphpMyAdmin:phpMyAdminisawebbasedtoolwritteninPHPtomanagetheMySQL
database.Apartfromviewingthetables(andotherdbobjects),youcanperformlotofDBA
functionsthroughthewebbasedinterface.YoucanalsoexecuteanySQLqueryfromtheUI.
14. Setupsquidtocontrolinternetaccess:Squidisaproxycachingserver.Youcanusesquidto
controlinternetaccessatwork.ThisguidewillgiveajumpstartonhowtosetupsquidonLinux
torestrictinternetaccessinannetwork.
15. Addnewswapspace:Usedd,mkswapandswaponcommandstoaddswapspace.Youcan
eitheruseadedicatedharddrivepartitiontoaddnewswapspace,orcreateaswapfileonan
existingfilesystemanduseitasswapspace.
16. Installandconfiguresnort:Snortisafreelightweightnetworkintrusiondetectionsystemforboth
UNIXandWindows.Thisarticleexplainshowtoinstallsnortfromsource,writerules,and
performbasictesting.
17. RegisterRHEL/OELlinuxtosupport:IfyouhavepurchasedsupportfromOracleforyour
Linux,youcanregistertooraclesupportnetwork(ULN)usingup2dateasexplainedhere.
18. tftpbootsetup:YoucaninstallLinuxfromnetworkusingPXEbyinstallingandconfiguring
tftpbootserverasexplainedhere.
19. Deletealliptablesrules:Whenyouarestartingtosetupiptables,youmightwanttodelete(flush)
alltheexistingiptablesasshownhere.
20. Disablepingreplies:Someonecanfloodthenetworkwithpingf.Ifpingreplyisdisabledas
explainedherewecanavoidthisflooding.
21. Blockipaddressusingfail2ban:Fail2banisaintrusionpreventonframeworkthatscanslogfiles
forvariousservices(SSH,FTP,SMTP,Apache,etc.,)andbanstheIPthatmakestoomany
passwordfailures.Italsoupdatesiptlesfirewallrulestorejecttheseipaddresses.
22. Packagemanagementusingdpkg:Ondebian,youcaninstallorremovedebpackagesusingdpkg
utility.
23. Alfrescocontentmanagementsystem:Alfrescoisthebestopensourcecontentmanagement
system.EverythingyouneedtoknowtoinstallandconfigureAlfrescoisexplainedhere.
24. Bugzillabugtrackingsystem:Bugzillaisthebestopensourcebugtrackingsystem.Everything
youneedtoknowtoinstallandconfigureBugzillaisexplainedhere.
25. Rpm,deb,dpotandmsipackages:Thisarticleexplainshowtoviewandextractfilesfromvarious
packagetypesusedbydifferentLinux/UNIXdistributions.
26. Backupusingrsnapshot:Youcanbackupeitheralocalhostorremotehostusingrsnapshotrsync
utility.rsnapshotusesthecombinationofrsyncandhardlinkstomaintainfullbackupand
incrementalbackups.Onceyouvesetupandconfiguredrsnapshot,thereisabsolutelyno
maintenanceinvolvedinit.rsnapshotwillautomaticallytakecareofdeletingandrotatingtheold
backups.
27. CreateLinuxuser:Thisarticleexplainshowtocreateuserswithdefaultconfiguration,create
userswithcustomconfiguration,createusersinteractively,andcreatingusersinbulk.
28. MountandviewISOfile:ISOfilesaretypicallyusedtodistributetheoperatingsystem.Mostof
thelinuxoperatingsystemthatyoudownloadwillbeonISOformat.Thisexplainshowtoview
andmountanyISOfilebothasregularuseandasrootuser.
29. Managepasswordexpirationandaging:Linuxchagecommandcanbeusedtoperformseveral
practicalpasswordagingactivitiesincludinghowtoforceuserstochangetheirpassword.
30. ifconfigexamples:Interfaceconfiguratorcommandifconfigisusedtoinitializethenetwork
interfaceandtoenableordisabletheinterfacesasshowninthese7examples.
31. Oracledbstartupansthudown:EverysysadminshouldknowsomebasicDBAoperations.This
explainshowtoshutdownandstarttheoracledatabase.
32. PostgreSQLinstallandconfigure:SimilartomySQL,postgreSQLisveryfamousandfeature
packedfreeandopensourcedatabase.Thisisajumpstartguidetoinstallandconfigurepostgresql
9/30/2014 50 UNIX / Linux Sysadmin Tutorials
http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials/ 3/11
fromsourceonLinux.
33. MagicSysRqkey:HaveyouwonderedwhattheSysRqkeyonyourkeyboarddoes.Hereisone
useforit.YoucansafelyrebootLinuxusingthemagicSysRqkeyasexplainedhere.
34. WakeonlanTutorial:UsingWakeonlanWOL,youcanturnontheremoteserverswhereyou
donthavephysicalaccesstopressthepowerbutton.
35. Listhardwarespecusinglshw:ls+hw=lshw,whichliststhehardwarespecsofyoursystem.
36. Viewhardwarespecusingdmidecode:dmidecodecommandreadsthesystemDMItableto
displayhardwareandBIOSinformationoftheserver.Apartfromgettingcurrentconfigurationof
thesystem,youcanalsogetinformationaboutmaximumsupportedconfigurationofthesystem
usingdmidecode.Forexample,dmidecodegivesboththecurrentRAMonthesystemandthe
maximumRAMsupportedbythesystem.
37. Usethesupporteffectively:Companiesspendlotofcashonsupportmainlyfortworeasons:1)
Togethelpfromvendorstofixcriticalproductionissues2)Tokeepuptodatewiththelatest
versionofthesoftwareandsecuritypatchesreleasedbythevendors.Inthisarticle,Ivegiven10
practicaltipsforDBAs,sysadminsanddeveloperstousetheirhardwareandsoftwaresupport
effectively.
38. Install/UpgradeLAMPusingYum:InstallingLAMPstackusingyumisagoodoptionfor
beginnerswhodontfeelcomfortableinstallingfromsource.Also,InstallingLAMPstackusing
yumisagoodchoice,ifyouwanttokeepthingssimpleandjustusethedefaultconfiguration.
39. Templatetotrackyourhardwareassests:Ifyouaremanagingmorethanoneequipmentinyour
organization,itisveryimportanttodocumentandtrackALLinformationabouttheservers
effectively.Inthisarticle,Ihavelisted36attributesthatneedstobetrackedforyourequipments,
withanexplanationonwhyitneedstobetracked.Ihavealsoprovidedaspreadsheettemplate
withthesefieldsthatwillgiveyouajumpstart.
40. DisableSELinux:IfyoudontunderstandhowSELinuxworksandthefundamentaldetailson
howtoconfigureit,keepingitenabledwillcauselotofissues.Untilyouunderstandthe
implementationdetailsofSELinuxyoumaywanttodisableittoavoidsomeunnecessaryissues
asexplainedhere.
41. InstallPHP5fromsource:ThisisastepbystepguidetoinstallPHP5fromsourceonUNIX
environment.
42. InstallMySQLfromsource:ThisisastepbystepguidetoinstallMySQLfromsourceonUNIX
environment.
43. LaunchLinuxclientsonwindows:IfyouareusingSSHclienttoconnecttoLinuxserverfrom
yourWindowslaptop,sometimesitmaybenecessarytolaunchUIapplicationontheremote
Linuxserver,buttodisplaytheUIonthewindowslaptop.Cygwincanbeusedtoinstallsoftware
onLinuxfromWindowsandlaunchLinuxXclientsoftwareonWindows.
44. IPCS:IPCallowstheprocessestocommunicatewitheachanother.Theprocesscanalso
communicatebyhavingafileaccessibletoboththeprocesses.Processescanopen,andread/write
thefile,whichrequireslotofI/Ooperationthatconsumestime.Thisexplainsdifferenttypesof
IPCSandprovides10IPCScommandexamples.
45. LogicalVolumeManager:UsingLVMwecancreatelogicalpartitionsthatcanspanacrossone
ormorephysicalharddrives.YoucancreateandmanageLVMusingvgcreate,lvcreate,and
lvextendlvm2commandsasshownhere.
46. 15Tcpdumpexamples:tcpdumpisanetworkpacketanalyzer.tcpdumpallowsustosavethe
packetsthatarecaptured,sothatwecanuseitforfutureanalysis.Thesavedfilecanbeviewed
bythesametcpdumpcommand.Wecanalsouseopensourcesoftwarelikewiresharktoreadthe
tcpdumppcapfiles.
47. Managepartitionusingfdisk:Usingfdiskyoucancreateamaximumoffourprimarypartition,
deleteanexistingpartition,orchangeexistingpartition.Usingfidskyouareallowedtocreatea
maximumoffourprimarypartition,andanynumberoflogicalpartitions,basedonthesizeofthe
disk.
48. VMWarefundamentals:Atsomepointeverysysadminshoulddealwithvirtualization.VMWare
isaverypopularchoisetovirtualizeyourserverenvironment.Thisarticlewillprovidethe
fundamentalinformationforyoutogetajumpstartonVMWare.
9/30/2014 50 UNIX / Linux Sysadmin Tutorials
http://www.thegeekstuff.com/2010/12/50-unix-linux-sysadmin-tutorials/ 4/11
180 475 Suka
49. Rotatethelogsautomatically:Manginglogfilesisanimportatpartofsysadminlife.logrotate
makeiteasybyallowingyoutosetupautomaticalogrotationbasedonseveralconfigurations.
Usinglogrotateyoucanalsoconfigureittoexecutecustomshellscriptsimmediatelyafterlog
rotation.
50. PasswordlessSSHloginsetup:Usingsshkeygenandsshcopyidyoucansetuppasswordless
logintoremoteLinuxserver.sshkeygencreatesthepublicandprivatekeys.sshcopyidcopies
thelocalhostspublickeytotheremotehostsauthorized_keysfile.
WellbepostinglotofLinuxsysadminrelatedtutorialsintheupcomingmonths.Makesuretosubscribe
toourblogtoreceivethosetutorials.
you@address.com
Subscribe
>Addyourcomment
Linuxprovidesseveralpowerfuladministrativetoolsandutilitieswhich
willhelpyoutomanageyoursystemseffectively.Ifyoudontknowwhatthesetoolsareandhowto
usethem,youcouldbespendinglotoftimetryingtoperformeventhebasicadministrativetasks.The
focusofthiscourseistohelpyouunderstandsystemadministrationtools,whichwillhelpyouto
becomeaneffectiveLinuxsystemadministrator.
GettheLinuxSysadminCourseNow!
Ifyouenjoyedthisarticle,youmightalsolike..
1. 50LinuxSysadminTutorials
2. 50MostFrequentlyUsedLinuxCommands
(WithExamples)
3. Top25BestLinuxPerformanceMonitoringand
DebuggingTools
4. Mommy,Ifoundit!15PracticalLinuxFind
CommandExamples
5. Linux101Hacks2ndEditioneBook
AwkIntroduction7AwkPrint
Examples
AdvancedSedSubstitutionExamples
8EssentialVimEditorNavigation
Fundamentals
25MostFrequentlyUsedLinux
IPTablesRulesExamples
TurbochargePuTTYwith12Powerful
AddOns

You might also like