Tải bản đầy đủ (.pdf) (788 trang)

OReilly ubuntu hacks tips and tools for exploring using and tuning linux jun 2006 ISBN 0596527209

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.34 MB, 788 trang )

UbuntuHacks
ByBillChilders,JonathanOxer,KyleRankin
...............................................
Publisher:O'Reilly
PubDate:June2006
PrintISBN-10:0-596-52720-9
PrintISBN-13:978-0-59-652720-4
Pages:447

TableofContents|Index

TheUbuntudistributionsimplifiesLinuxbyprovidingasensiblecollectionofapplications,
aneasy-to-usepackagemanager,andlotsoffine-tuning,whichmakeitpossiblythebest
Linuxfordesktopsandlaptops.ReadersofbothLinuxJournalandTUXMagazine
confirmedthisbyvotingUbuntuasthebestLinuxdistributionineachpublication's2005
ReadersChoiceAwards.Noneofthatsimplification,however,makesUbuntuanylessfunif
you'reahackerorapoweruser.
Likeallbooksinthe"Hacks"series,UbuntuHacksincludes100quicktipsandtricksforall
usersofalltechnicallevels.Beginnerswillappreciatetheinstallationadviceandtipson
gettingthemostoutofthefreeapplicationspackagedwithUbuntu,whileintermediate
andadvancedreaderswilllearntheins-and-outsofpowermanagement,wirelessroaming,
3Dvideoacceleration,serverconfiguration,andmuchmore.


UbuntuHacks
ByBillChilders,JonathanOxer,KyleRankin
...............................................
Publisher:O'Reilly
PubDate:June2006
PrintISBN-10:0-596-52720-9
PrintISBN-13:978-0-59-652720-4


Pages:447

TableofContents|Index















































Copyright
creditsCredits
Preface
Chapter1.GettingStarted
Hack1.Test-DriveUbuntu
Hack2.GetHelp
Hack3.MakeLiveCDDataPersistent
Hack4.CustomizetheUbuntuLiveCD
Hack5.InstallUbuntu
Hack6.Dual-BootUbuntuandWindows
Hack7.MoveYourWindowsDatatoUbuntu

Hack8.InstallUbuntuonaMac
Hack9.SetUpYourPrinter
Hack10.InstallUbuntuonanExternalDrive
Hack11.InstallfromaNetworkBootServer
Hack12.SubmitaBugReport
Hack13.UsetheCommandLine
Hack14.GetProductivewithApplications
Chapter2.TheLinuxDesktop
Hack15.GetUndertheHoodoftheGNOMEDesktop
Hack16.TweaktheKDEDesktop
Hack17.SwitchtoaLighterWindowManager
Hack18.InstallJava
Hack19.SearchYourComputer

















































































Hack20.AccessRemoteFilesystems
Hack21.TweakYourDesktopLikeaPro
Hack22.SyncYourPalmPDA
Hack23.SyncYourPocketPC
Hack24.CustomizetheRight-ClickContextualMenu
Hack25.DownloadandShareFileswiththeBestP2PSoftware
Hack26.MakeYourOwnPDFs
Hack27.BlogwithUbuntu
Chapter3.Multimedia
Hack28.InstallMultimediaPlug-ins
Hack29.WatchVideos
Hack30.PlayDVDs
Hack31.BuySongsattheiTunesMusicStore
Hack32.GetaGriponCDRipping
Hack33.BurnCDsandDVDs
Hack34.AutomateAudioCDBurning
Hack35.RipandEncodeDVDs
Hack36.CreateaVideoDVD
Hack37.ConnecttoaDigitalCamera
Chapter4.MobileUbuntu
Hack38.PutYourLaptoptoSleep
Hack39.HibernateYourLaptop
Hack40.ProlongYourBatteryLife
Hack41.GetProprietaryWirelessCardsWorking
Hack42.RoamWirelessly
Hack43.MakeLaptopSettingsRoamwithYourNetwork
Hack44.MakeBluetoothConnections
Hack45.ExpandYourLaptop
Hack46.HotswapYourLaptop'sOpticalDrive

Chapter5.X11
Hack47.ConfigureMultibuttonMice
Hack48.EnableYourMultimediaKeyboard
Hack49.ConfigureaTouchpad
Hack50.ConnectMultipleDisplays
Hack51.ChangetheUbuntuSplashScreen
Hack52.Enable3-DVideoAcceleration
Hack53.MakeYourFontsPretty
Chapter6.PackageManagement
Hack54.ManagePackagesfromtheCommandLine

















































































Hack55.ManagePackageswithSynaptic

Hack56.ManagePackageswithAdept
Hack57.InstallandRemoveStandalone.debFiles
Hack58.SearchforPackagesfromtheCommandLine
Hack59.InstallSoftwarefromSource
Hack60.ModifytheListofPackageRepositories
Hack61.CachePackagesLocallywithApt-cacher
Hack62.CreateanUbuntuPackage
Hack63.CompileaSourcePackage
Hack64.ConvertNon-UbuntuPackages
Hack65.CreateYourOwnPackageRepository
Hack66.ConvertDebiantoUbuntu
Chapter7.Security
Hack67.LimitPermissionswithsudo
Hack68.ManageSecurityUpdates
Hack69.ProtectYourNetworkwithaFirewall
Hack70.UseanEncryptedFilesystemtoProtectYourData
Hack71.EncryptYourEmailandImportantFiles
Hack72.SurftheWebAnonymously
Hack73.KeepWindowsMalwareoffYourSystem
Chapter8.Administration
Hack74.EditConfigurationFiles
Hack75.ManageUsersandGroups
Hack76.MountAnyFilesystem
Hack77.ControlStartupServices
Hack78.BuildKernelstheUbuntuWay
Hack79.BackUpYourSystem
Hack80.CloneanInstallation
Hack81.RescueanUnbootableSystem
Hack82.ChecktheCaptain'sLog
Hack83.MountRemovableDeviceswithPersistentNames

Hack84.MountRemoteDirectoriesSecurelyandEasily
Hack85.MakeVideosofYourTech-SupportQuestions
Hack86.SynchronizeFilesAcrossMachines
Chapter9.VirtualizationandEmulation
Hack87.RunWindowsApplications
Hack88.PlayWindowsGames
Hack89.RunUbuntuInsideWindows
Hack90.UseXentoHostVirtualMachines




























Hack91.CreateanUbuntu/XenVirtualMachine
Hack92.SplitYourMachine'sPersonality
Chapter10.SmallOffice/HomeOfficeServer
Hack93.InstallandConfigureanUbuntuServer
Hack94.BuildaFileServer
Hack95.AdministerYourServerRemotely
Hack96.BuildaWebServer
Hack97.BuildanEmailServer
Hack98.BuildaCachingProxyServer
Hack99.BuildaDHCPServer
Hack100.BuildaDomainNameServer
Colophon
Index


Copyright©2006O'ReillyMedia,Inc.Allrightsreserved.
PrintedintheUnitedStatesofAmerica.
PublishedbyO'ReillyMedia,Inc.,1005GravensteinHighway
North,Sebastopol,CA95472.
O'Reillybooksmaybepurchasedforeducational,business,or
salespromotionaluse.Onlineeditionsarealsoavailablefor
mosttitles().Formoreinformation,
contactourcorporate/institutionalsalesdepartment:(800)
998-9938or
NutshellHandbook,theNutshellHandbooklogo,andthe

O'ReillylogoareregisteredtrademarksofO'ReillyMedia,Inc.
TheHacksseriesdesignations,UbuntuHacks,theimageofa
tuningfork,andrelatedtradedressaretrademarksofO'Reilly
Media,Inc.
Manyofthedesignationsusedbymanufacturersandsellersto
distinguishtheirproductsareclaimedastrademarks.Where
thosedesignationsappearinthisbook,andO'ReillyMedia,Inc.
wasawareofatrademarkclaim,thedesignationshavebeen
printedincapsorinitialcaps.
Whileeveryprecautionhasbeentakeninthepreparationofthis
book,thepublisherandauthorsassumenoresponsibilityfor
errorsoromissions,orfordamagesresultingfromtheuseof
theinformationcontainedherein.
Smallprint:Thetechnologiesdiscussedinthispublication,the
limitationsonthesetechnologiesthattechnologyandcontent
ownersseektoimpose,andthelawsactuallylimitingtheuseof
thesetechnologiesareconstantlychanging.Thus,someofthe
hacksdescribedinthispublicationmaynotwork,maycause
unintendedharmtosystemsonwhichtheyareused,ormay
notbeconsistentwithapplicableuseragreements.Youruseof


thesehacksisatyourownrisk,andO'ReillyMedia,Inc.
disclaimsresponsibilityforanydamageorexpenseresulting
fromtheiruse.Inanyevent,youshouldtakecarethatyouruse
ofthesehacksdoesnotviolateanyapplicablelaws,including
copyrightlaws.





Credits
AbouttheAuthors
JonathanOxer(ispresidentofLinux
Australia,thenationalorganizationforLinuxusersand
developers.Heistheauthorof"HowToBuildAWebsiteAnd
StaySane"(),writesregularlyfor
TheAgeandSydneyMorningHeraldnewspapers,andhis
articleshavebeentranslatedintoFrench,BrazilianPortuguese,
Italian,Norwegian,andSpanishandhaveappearedindozens
ofpublications.
In1994,hefoundedoneofthefirstbusinessesintheworldto
specializeindynamicwebsitesandonlinecontent
management,andin1995hebecameoneofthefirstpeopleto
everdoreal-timeeventcoverageviatheInternetwhenalive
feedwasrunfromtheflooroftheBicycleIndustryTradeShow
inSydney,Australia.Hiscompany,InternetVisionTechnologies
(),hassincedevelopedwebsites,
intranets,extranets,andcustomwebapplicationsforclients
rangingfrombackyardbusinessestomultinationalcorporations.
JonathanhasbeenaDebiandevelopersince2002andhas
convenedtheDebianMiniconfinadifferentcityeveryyear
since2003.Hehaspresenteddozensoftutorials,papers,and
keynotesonvarioustechnologyandbusinesstopicsatboth
corporateandgovernmentseminars;atconferences,including
LinuxTag,linux.conf.au,OpenSourceDevelopersConference,
andDebianMiniconf;andatusergroups,includingMelbourne
PHPUserGroupandLinuxUsersVictoria.Hesitsonthe
AdvisoryGroupofSwinburneUniversity'sCentrefor
CollaborativeBusinessInnovation,whichisresponsiblefor

researchingandformulatingIT-related,post-graduate
curriculumstrategies,andontheAustralianFederal


government'se-ResearchCoordinatingCommitteeReference
Group.
HelivesinMelbourne,Australiawithhiswife,daughter,and
son.
KyleRankinisasystemadministratorforQuinStreet,Inc.,the
currentpresidentoftheNorthBayLinuxUsersGroup,andthe
authorofKnoppixHacks,KnoppixPocketReference,andLinux
MultimediaHacks(allfromO'Reilly).KylehasbeenusingLinux
inoneformoranothersinceearly1998.Inhisfreetime,he
eitherwritesordoesprettymuchthesamethinghedoesat
work:workswithLinux.
BillChildersisDirectorofEnterpriseSystemsforQuinstreet,
Inc.He'sbeenworkingwithLinuxandUnixsincebeforeitwas
cool,andpreviouslyworkedforSunMicrosystemsandSet
Engineering.Inhissparetime,heworkswiththeGilroyGarlic
FestivalAssociationasoneofitschairmen,andenjoysplaying
withhischildren.

Contributors
ScottGrannemanspecializesinhelpingschools,nonprofits,
andbusinessesharnessemergingtechnologies.Through
presentations,consulting,andpublications,Scottexplicates
thepoweroftheInternet,theWorldWideWeb,andrelated
technologies.Hehashelpededucatethousandsofpeopleof
allagesfrompreteenstoseniorcitizensonawidevarietyof
topics.AmixofeducationalexperienceandpracticalknowhowenablesScotttodeliverthekindofhands-onsolutions

hisclientsexpect.And,astheInternetcontinuesits
phenomenalgrowth,hehelpshisclientstakefulladvantage
ofeachnewevolutionofthisemergingtechnology.Detailed
informationisavailableatwww.granneman.com.


BrianJepsonisanO'Reillyeditor,programmer,and
coauthorofMacOSXTigerforUnixGeeksandLearning
UnixforMacOSXPanther.He'salsoavolunteersystem
administratorandall-aroundgeekforAS220,anonprofit
artscenterinProvidence,RhodeIsland.AS220givesRhode
Islandartistsuncensoredandunjuriedforumsfortheir
work.Theseforumsincludegalleries,performancespace,
andpublications.Brianseestoitthattechnology,especially
freesoftware,supportsthatmission.
ThomasPletcheroperatesacommunicationsagencyin
upstateNewYorkusingUbuntuandotherfreeandopen
sourcesoftware.Heisalsoawriter/partnerat
CommunityMX.com.HeandhiswifeBarbaraoperateasite
(devotedtorescuingGreat
Pyreneesdogs,awonderfulbreedhehopestoseeonthe
coverofanO'Reillybookbeforelong.

Acknowledgments
Theauthorswouldliketothankthepeoplewho
madethisbookpossible.
Jonathan
ThebiggestthanksdefinitelyhavetogotomywifeAnnandour
childrenAmeliaandThomas,whoforseveralmonthsbarely
sawmefromoneweektothenext.WritingUbuntuHackshas

beenoneofthoseperiodswheneverythingelse,including
sleep,becamesecondarytojustgettingthejobdone,andmy
familywasamazinglysupportiveandunderstandingthrough
everything.


ThanksalsotomycoauthorsKyleRankinandBillChilders,who
sowillinglysharedtheirknowledgeofallthingsLinux,andthe
contributingwriterswhoputinabigefforttosupplementthe
bodyofthetextwiththeirparticularareasofexpertise.Andthe
wholeUbuntuHackscircuswouldn'thavebeenpossiblewithout
oureditor,BrianJepson,actingasringmasterandkeepingall
ourperformancesonschedulewhileevenmanagingto
contributesomeofhisown.
Finally,withouttheCanonicalteamtherewouldn'tbeanUbuntu
tohackon,andwithoutDebiantherewouldneverhavebeen
Canonical,andwithoutthewholefree/opensourcesoftware
communitytherewouldneverhavebeenDebian,sothe
ultimatethankshavetogototheamazingcommunitythat
we'reallpartof.Toeverypersonwhohaseverwrittenopen
sourcesoftware,orsubmittedabugreport,orwrittenahow-to,
ormaintainedaDebianpackage,orstoodonastreetcorner
andhandedoutUbuntuCDs:thankyou.Thisbookiswrittenin
yourhonor.

Kyle
FirstI'dliketothankmywifeJoyforhelpingmeyetagain
throughthecrunchperiodofthisbook.I'dalsoliketothank
DavidBricknerforbringingmeonthisproject,alongwithBrian
Jepsonforhisguidanceineditingthebook.

Thisbookwastheresultofagreatteameffort,somanythanks
toBillandJonforalltheirhardworktomakethebookhappen,
andthankstoallthecontributingwriters.
Finally,I'dliketothankUbuntu'samazingcommunityofusers
anddevelopersfortheirhardworkinmakingUbuntuasuccess
insuchashortamountoftime.


Bill
Iwanttokickoffthisacknowledgmentssectionbythankingand
recognizingthemostimportantpeopleinmylife:myfamily.
GillianandConner,thisbookisforyou.ThisiswhyDaddy's
beenatthekeyboardforsomanynightsandweekends.Special
thankstoKellyforputtingupwithmewhileIundertookthis
projectamongstalltheotherthingsIdoIloveyou,honey.
You'vebeenatremendousinfluenceandsourceofsupport,and
Icouldn'thavepulledanyofthisoffwithoutyou.
Thankstomyparentsandgrandparentsforgettingmemyfirst
computerandsupportingmyinitial"addiction"Iwouldn'tbe
whereIamtodaywithoutthem.
Thankstoalltheprogrammers,documentationpeople,bug
testers,andeveryoneelsewhocontributestotheUbuntuand
Debianprojects.Everyoneofyoushouldbeproudofyour
workyou'vecreatedsomethingtrulyspecial.Thankstothe
crowdof#linuxtoo,particularlyJorge,whoseongoingpursuit
ofshinystuffledmetoruntheprereleaseofWartywayback
when.AlsothankstomyfellowwriterKyle:allthestuffwe've
beenthroughhasbeenatotalblast,andI'mlookingforwardto
thefuture.
Finally,thankstoDavidBricknerandBrianJepsonforgivingme

thisshotandforeditingallmymistaeks(sic).




Preface
ThefirstreleaseofUbuntu,theWartyWarthog,wasmade
availabletotheworldonOctober20,2004.Lessthantwoyears
later,Ubuntuisnowthenumber-onemostpopularLinux
versionatDistroWatch.com,faraheadofthedistributionin
secondplace.Countlessarticles,reviews,andblogpostings
havebeenwrittenaboutUbuntuanditssisterdistros,Kubuntu
andEdubuntu.InMacedonia,Ubuntuwillbeinstalledin468
schoolsand182computerlabs.InSouthAfrica,HPisgoingto
offerdesktopsandnotebookswithUbuntuonthem.Aroundthe
world,hundredsofthousandsofpeoplehaveinstalledUbuntu,
and,inmanycases,itwasthefirstLinuxdistrothey'dever
tried.FormanyofthosenewLinuxusers,Ubuntuhasbeenso
goodthatthey'veswitchedtoLinux.ForaLinuxdistrothat's
stillaninfant,thisisremarkablestuff!
WhyhasUbuntubeensosuccessful?Technically,it'sbasedon
Debian,whichisanexcellentfoundationforaLinuxdistro,but
Ubuntuhasaddedaleveloffinishandpolishthathasmadeita
joytousefornewbies,thoughitisstillapowerhouseformore
experiencedusers.It'sincrediblyup-to-date;ateamof
dedicateddevelopersensuresthateverything"justworks,"with
regularupdatestothevariouspackagesthatmakeupthedistro
andaroughlysix-monthreleaseschedulebetweendistros.
Butthesecretbehindthephenomenalsuccessandgrowthof
Ubuntuisreallyoneman:SouthAfricanMarkShuttleworth.

AfterfoundingThawte,acompanyprovidingdigitalcertificates,
whenhewas22,Shuttleworthsoldthecompanyfouryears
latertoVeriSignforalargeamountofmoney.Afterfulfillinghis
dreamofgoingintospace,hedecidedtofulfillanotherand
buildthebestLinuxdistrointheworld.Inthathehas
succeeded.
Butit'salsoaboutprincipleswithShuttleworth.Hehasplentyof


money,andhewantstodothingswithhisfortunethatwill
changetheworld.Consequently,Ubuntuwillalwaysaimforthe
highestquality,anditwillalwaysbefree.ThenameUbuntu
itselfisladenwithmeaning,asitisanAfricanwordmeaning
both"humanitytoothers"and"IamwhatIambecauseofwho
weallare,"whileKubuntumeans"towardshumanity."
ShuttleworthhaspromulgatedtheUbuntuCodeofConduct,
whichstatesthatmembersofthecommunitymustpractice
consideration,respect,andcollaboration.
ThisisabookwrittenbypassionateUbuntuandKubuntuusers
whoareexcitedtotalkaboutapowerful,cooldistrothatmeets
theneedsofnovice,intermediate,andexperiencedusersina
widevarietyofways.Thehacksinthisbookcovertheessential
areasofUbuntu,andthey'llhelpyoumaximizeyouruseofthe
distro.Whetheryouwanttoplaymusicandmovies,oruse
Ubuntuonyourlaptopasyoutravel,orinstalljustaboutany
softwarepackageyoucouldeverwant,orrunotheroperating
systemsinsideUbuntu,we'vegotitallcovered.
Weknowyou'llgetalotoutofUbuntuHacks,butwealsowant
toencourageyoutogivebacktothecommunityandhelpgrow
Ubuntu:

VisitthemainUbuntuandKubuntuwebsitesat
and.The
entiresitesareworthexploringindepth,buttheWikis
especiallyofferawealthofusefulinformation.
DownloadUbuntuandofferittofriends,family,and
acquaintances.Heck,offerittototalstrangers!Themore
peoplewhotryUbuntu,themorepeoplewhowilluseUbuntu.
Ifyoudon'twanttodownloadthedistro,youcanrequestfree
CDsat.Don'tbeshyaskandyeshall
receive!
Ifyouknowhowtoprogram,considerbecomingaUbuntu


developer.Ifyoudon'tknowhowtoprogram,there'sstillplenty
ofworkyoucando.Eitherway,headoverto
Ifyouthinkyouhavethe
rightstuff,youcanevenapplyforworkat
/>BuysomeUbuntuswagfromtheUbuntuShop
(ordonatemoneyat
/>Mostimportantly,telltheworldaboutUbuntu!Let'sgetthe
wordout:there'sanawesome,free,super-powerfuloperating
systemthatanyonecanusenamedUbuntu,andit'smadefor
you.

WhyUbuntuHacks?
Thetermhackinghasabadreputationinthepress.Theyuseit
torefertopeoplewhobreakintosystemsorwreakhavocwith
computersastheirweapon.Amongpeoplewhowritecode,
though,thetermhackreferstoa"quick-and-dirty"solutiontoa
problem,oracleverwaytogetsomethingdone.Andtheterm

hackeristakenverymuchasacompliment,referringto
someoneasbeingcreative,havingthetechnicalchopstoget
thingsdone.TheHacksseriesisanattempttoreclaimthe
word,documentthegoodwayspeoplearehacking,andpass
thehackerethicofcreativeparticipationontotheuninitiated.
Seeinghowothersapproachsystemsandproblemsisoftenthe
quickestwaytolearnaboutanewtechnology.

HowtoUseThisBook
Youcanreadthisbookfromcovertocoverifyoulike,buteach
hackstandsonitsown,sofeelfreetobrowseandjumptothe
differentsectionsthatinterestyoumost.Ifthere'sa
prerequisiteyouneedtoknowabout,across-referencewill


guideyoutotherighthack.

HowThisBookIsOrganized
Thisbookisdividedinto10chapters,organizedbysubject:

Chapter1,GettingStarted
ThischaptershowsyouhowtogetstartedwithUbuntu.
WhetheryouwanttogiveitawhirlwithaliveCD,oryou're
readytojumprightinandinstallUbuntuonyourcomputer,
you'llfindwhatyouneedhere.Inadditiontogettingallthe
informationyouneedtoinstallUbuntuonyoursystem,
you'llalsolearnhowtogetstartedwiththeLinuxcommand
line,setupyourprinter,fileabugreport,andmore.

Chapter2,TheLinuxDesktop

You'regoingtospendalotoftimeinfrontofamouse,
keyboard,andmonitor,workingwithoneoftheLinux
desktops.Thischapterhelpsyougetthemostoutofthe
GNOMEandKDEdesktopenvironmentsforLinux,andeven
helpsyoufindoutaboutafewothersthatareworth
checkingout.You'llalsolearnsuchthingsashowtoget
Javasetup,howtoworkwithfilesonremotecomputers,
andhowtogetUbuntutalkingtohandheldcomputers.

Chapter3,Multimedia
Thischaptergetsthemusicandmoviesrunningsoyoucan
havesomefuninbetweenalltheworkyougetdonewith
Ubuntu.You'lllearnhowtoplaynearlyanykindofaudio


andvideo,andburnfiles,music,andmoviestooptical
discs.

Chapter4,MobileUbuntu
Ifyou'reusingUbuntuonanotebookcomputer,you're
probablygoingtowanttocutafewwires.Thischapter
helpsyougetgoingwithvariouswirelesscards.You'llalso
learnhowtogetthemostoutofyourlaptop,fromsaving
energytoinstallingadd-oncards.

Chapter5,X11
ThischaptershowsyouhowtotweakX11,thewindowing
systemthatlurksbeneaththeshinyveneerofKDEand
GNOME.You'lllearnhowtogetyourmouseandkeyboard
workingjustright,andalsohowtogetX11configuredsoit

takesfulladvantageofthegraphicsadapterinyour
computer.

Chapter6,PackageManagement
Tosomeextent,anyLinuxdistributionisabigcollectionof
packagesheldtogetherbyawholelotofinterestingand
usefulglue.Ubuntu'sgreatadvantageisthequalityofthose
packingsandallthetestingandimprovementthatgoesinto
them.Thischaptershowsyouhowtoworkwithpackages,
whetheryou'reinstallingthem,findingnewonesfrom
beyondtheedgesoftheUbuntuuniverse,orcreatingyour
own.


Chapter7,Security
Thischaptershowsyouhowtotightenupsecurityonyour
system.You'lllearnthebasicsofhowthesudocommand
keepsyouandyourfellowusersoutoftrouble,howto
protectyournetworkfromintruders,andevenhowtokeep
yourdatasafeifoneofthebadguysdoesmakeitin.

Chapter8,Administration
Everynowandthen,you'regoingtohavetotakeabreak
fromthefunofusingUbuntuanddosomeadministrative
tasks.Whetheryou'readdinganewuser,tweakingyour
system'sconfiguration,ordoingthosebackupsyoushould
havedonelongago,you'llfindwhatyouneedinthis
chapter.

Chapter9,VirtualizationandEmulation

ThischaptershowsyouhowtorunUbuntuinsideofother
operatingsystems,andotheroperatingsystemsinsideof
Ubuntu.It'sallmadepossiblebyacombinationof
emulationandvirtualization,whicheffectivelyletsyouruna
computerinsideofacomputer.

Chapter10,SmallOffice/HomeOfficeServer
Ubuntuisn'tjustagreatdesktopoperatingsystem;italso
makesafantasticbasisforaserver.Inthischapter,you'll
learneverythingfromdoingabasicserverinstallto
installingnetworkservicessuchasDNS,mail,Apache,and
more.


ConventionsUsedinThisBook
Thefollowingisalistofthetypographicalconventionsusedin
thisbook:

Italic
Usedforemphasisandnewtermswheretheyaredefined,
aswellastoindicateUnixutilities,URLs,filenames,
filenameextensions,anddirectory/foldernames.For
example,apathinthefilesystemwillappearas/usr/local.

Constantwidth
Usedtoshowcodeexamples,thecontentsoffiles,and
consoleoutput,aswellasthenamesofvariables,
commands,andothercodeexcerpts.

Constant

width
bold
Usedtohighlightportionsofcode,eitherforemphasisorto
indicatetextthatshouldbetypedbytheuser.

Constantwidthitalic

Usedincodeexamplestoshowsampletexttobereplaced
withyourownvalues.


Graytype
Usedtoindicateacross-referencewithinthetext.

Usedinfilecontentsattheendofalineofcodetoindicate
thatitcarriesovertothefollowinglinebecauseofspace
limitations.Youshouldentertheselinesasonelineinthe
actualfiles.
Youshouldpayspecialattentiontonotessetapartfromthe
textwiththefollowingicons:

Thisisatip,suggestion,orgeneralnote.Itcontainsuseful
supplementaryinformationaboutthetopicathand.

Thisisawarningornoteofcaution,oftenindicatingthatyourmoney
oryourprivacymightbeatrisk.

Thethermometericons,foundnexttoeachhack,indicatethe
relativecomplexityofthehack:


UsingCodeExamples


Thisbookisheretohelpyougetyourjobdone.Ingeneral,you
mayusethecodeinthisbookinyourprogramsand
documentation.Youdonotneedtocontactusforpermission
unlessyou'rereproducingasignificantportionofthecode.For
example,writingaprogramthatusesseveralchunksofcode
fromthisbookdoesnotrequirepermission.Sellingor
distributingaCD-ROMofexamplesfromO'Reillybooksdoes
requirepermission.Answeringaquestionbycitingthisbook
andquotingexamplecodedoesnotrequirepermission.
Incorporatingasignificantamountofexamplecodefromthis
bookintoyourproduct'sdocumentationdoesrequire
permission.
Weappreciate,butdonotrequire,attribution.Anattribution
usuallyincludesthetitle,author,publisher,andISBN.For
example:"UbuntuHacksbyJonathanOxer,KyleRankin,and
BillChilders.Copyright2006O'ReillyMedia,Inc.,0-596-527209."
Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseor
thepermissiongivenabove,feelfreetocontactusat


SafariEnabled

WhenyouseeaSafari®Enabledicononthecover
ofyourfavoritetechnologybook,thatmeansthebookis
availableonlinethroughtheO'ReillyNetworkSafariBookshelf.
Safarioffersasolutionthat'sbetterthane-books.It'savirtual
librarythatletsyoueasilysearchthousandsoftoptechbooks,

cutandpastecodesamples,downloadchapters,andfindquick
answerswhenyouneedthemostaccurate,currentinformation.
Tryitforfreeat.


HowtoContactUs
Wehavetestedandverifiedtheinformationinthisbooktothe
bestofourability,butyoumayfindthatfeatureshavechanged
(oreventhatwehavemademistakes!).Asareaderofthis
book,youcanhelpustoimprovefutureeditionsbysendingus
yourfeedback.Pleaseletusknowaboutanyerrors,
inaccuracies,bugs,misleadingorconfusingstatements,and
typosthatyoufindanywhereinthisbook.
Pleasealsoletusknowwhatwecandotomakethisbookmore
usefultoyou.Wetakeyourcommentsseriouslyandwilltryto
incorporatereasonablesuggestionsintofutureeditions.Youcan
writetousat:
O'ReillyMedia,Inc.
1005GravensteinHighwayNorth
Sebastopol,CA95472
800-998-9938(intheU.S.orCanada)
707-829-0515(international/local)
707-829-0104(fax)
Toasktechnicalquestionsortocommentonthebook,send
emailto:

ThewebsiteforUbuntuHackslistsexamples,errata,andplans
forfutureeditions.Youcanfindthispageat:
/>Formoreinformationaboutthisbookandothers,seethe
O'Reillywebsite:




GotaHack?
ToexploreHacksbooksonlineortocontributeahackforfuture
titles,visit:



Chapter1.GettingStarted
Anoperatingsystemtakessomegettingusedto.Whetheryou
arenewtoUbuntuornewtoLinuxitself,therearesomebasic
thingsyouneedtogetfamiliarwithbeforeyoucanmoveon.
Thehacksinthischaptercoverthosebasicsandthensome.
TheUbuntuLiveCDisagoodwaytoexploreUbuntuwithout
changinganythingonyourharddrive.Thischapterexplains
howtogetupandrunningwiththeLiveCD,andevenshows
youhowtouseitwithamemorysticktokeepyoursettings
anddocumentsaroundbetweenreboots.You'llalsolearnhow
toinstallUbuntu,whetheryouwanttomakeitthesole
operatingsystemonyourcomputerorwanttodual-boot
betweenUbuntuandWindows.You'llevenlearnhowtoinstall
UbuntuonaMacintosh.
Thischapteralsocoversfundamentalssuchasgettingyour
printersetup,gettinghelp(andhelpingUbuntubysubmitting
bugreports),gettingstartedwiththecommandline,and
findingthemostimportantapplicationsyouneedtostart"doing
stuff"withUbuntu.



Hack1.Test-DriveUbuntu

UsetheUbuntuLiveCDtogettoknowLinuxbefore
installingitonyoursystem.Thisissimplythefastestand
safestwaytotryoutLinux.
ThoughLinuxonthedesktoplooksandbehavesalotlike
Windows,thesimplefactisitisn't.YourfavoriteWindows
programsprobablywon'truninLinux,itmaybedifficultto
migratedatafromyourWindowsinstall[Hack#7],andthe
yearsyou'vespentgettingusedtohowWindowsdoesthings
willprovemostlyuselesswhenitcomestounderstandinghow
Linuxworks.Withallofthisinmind,wouldn'titbegreatifyou
couldtryoutLinuxwithoutspendinghoursordaysgettingit
installedandconfiguredonyoursystem?Well,youcan.With
theUbuntuLiveCD,youcantakeLinuxforatest-drivetobe
certainyoureallywanttocommitthetimeandresourcesto
runningitfull-time.Thishackshowsyouhowtodownloadthe
UbuntuLiveCDandbootyoursystemusingit.Otherhacksin
thebookshowyouhowtogetaroundinGNOME[Hack#15]or
KDE[Hack#16],thetwopopulargraphicalenvironmentsthat
runontopofLinux.

DownloadingtheLiveCD
AliveCDisacompleteinstallationofLinuxthatrunsentirely
fromCD.WhileyouareusingaliveCD,nothingiswrittento
yourharddrive,soyourWindowsorMacOSinstallationisnot
affectedinanyway.However,becauseyou'rerunningfroma
CD,you'relimitedtousingonlytheprogramsthatareinstalled
ontheCD,andeverythingwillrunabitslowerbecauseCD



×