+ All Categories
Home > Documents > Comptia Linux Study Guide

Comptia Linux Study Guide

Date post: 09-Apr-2018
Category:
Upload: pramod-paul
View: 226 times
Download: 0 times
Share this document with a friend
18
8/8/2019 Comptia Linux Study Guide http://slidepdf.com/reader/full/comptia-linux-study-guide 1/18 The best free certification study guides, practice tests and forums ! Join Us! | Login | Help SEARCH Home | Exam Details | Free Tests | Study Guides | Glossary | Articles | Books & Training | Forums | Career & Jobs Certifications Microsoft CompTIA Cisco CI W LP I Red Hat I BM Site Tools Free Magazines White Papers Top Sites Contributors Site Map FA Q Practice Tests Forum Stats Users online total users: 196 Last Post COMPTIA Recertification new policy by Burnout01 Jan. 26, 2010 18:59 Board statistics We have a total of 86957 posts! Sponsored Links TechTutorials CertifyPro Certnotes Web Host Reviews CBT Training MCITP Boot Camp MCSE Training Computer Training Computer Classes By Alexis Laliberte Author's Foreword Over the years, I have come to gain a somewhat practical experience about Linux. Working on projects and developing custom solutions for customers has p rovided a real playground to learn how the thing works. Now I have decided to share this knowledge with others and have started this study guide as a personal project. During the writing, I have discovered that I didn’t know lots of things about the nuts and bolts of t he Linux Operating System. Some parts have been really easy to w rite and others have been challenging. I provide this study guide based on what I have learned and do ne. If any information contained within might need more explanations please feel free to send your comments and questions in the Linux/Unix forum . I will be pleased to answer you the best I can. Thanks to Jason Sprague for his support, thanks to all those who have contributed to this guide. Thanks to my girlfriend for liking the geek in me. Thanks to all my f riends at mcmcse.com. Alexis Laliberté 1. Concepts What is Linux? Linux is a 32 bit open source operating system. It is based on the very popular Unix operating system and it’s code is freely available (thus explaining the “open source” label as opposed to closed s ource where the code is not available freely). Linux is often referred to as being a “gathering of very cool software”. While this is not a bad description, a more precise definition would reveal that Linux refers to a sp ecific part of the “gathering”. Linux points to it ’s most basic element: the kernel. Everything else that is bundled with the Linux you get is an application. Figure 1.1 - Linus Torvalds is the founding father of Linux Picture by Christopher Gardner The Linux kernel is the operating system itself. There are different versions and they are released by a non-profit organization using a version number system. Each time something is added to the kernel, a new beta or experimental version is released. Generally, there can be up to 11 latest versions of the kernel available. The main ones being: The latest beta version: containing all the new features. This version may contain bugs or unstable code. Ex: 2.5.44 The latest stable version: this version is recognized as stable and its cod e is presumed without bug. Ex: 2.4.19 The latest prepatched versions: these are Linux alpha version and are being tested before released. Ex: the latest prepatched version for the beta version could be 2.5.8-pre3 The latest patched version: Finally, these are the patched versions for different major releases. They contain corrections to different bug reports and are being t ested. The last thing to know about kernel versions is the way the numbers are being assigned. For a X.Y.ZZ version, X would represent a major release version. Y is a minor release version and Z is a patch version number. In other words, when a bug is found and a patch released, o nly the Z number will change. When a bunch of new features are implemented Linux+ Study Guide (XK0-002) Tutorial Quick Links: Author's Foreword 1. Concepts 2. Planning the Implementation 3. Installation 4. Configuration 5. Administration 6. System Maintenance 7. Troubleshooting 8. Identify, Install, and Maintain System Hardware Sponsor Sponsor Training Picks CareerAcademy Expert-led On-Demand Certification training courses with 7x24 LIVE Mentoring. Topics cover MCSE 2008 Training , A+ Certification , IT Security CEH Training , Cisco Training and many more. Training Videos We offer streaming or CD c ertification training videos for Microsoft, CompTIA, Cisco, Citrix, Oracle, CISSP, CET, CWNA, LPI, SCJP, CIW, MOS, PMP and other certifications. View our free videos! EDULEARN Certification Training on CD-ROMs & Videos: Microsoft MCSE Training , A+ Certification , Windows 2003, & Free demos. MCSE certification training includes videos and labs. Online Computer Training by K Alliance. Certification training videos for MCTS, MCITP, Oracle OCA/OCP, A+, CCNA, RHCE and more. Our e- learning courses come with 24/7 online mentoring. More Training Page 1 of 18 CompTIA Linux+ Study Guide 1/27/2010 http://www.mcmcse.com/comptia/linux/studyguide.shtml
Transcript
Page 1: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 1/18

The best free certification study guides, practice tests and forums !

Join Us! | Login | Help

SEARCH

Home | Exam Details | Free Tests | Study Guides | Glossary | Articles | Books & Training | Forums | Career & Jobs

Certifications

Microsoft CompTIA Cisco CI W

LP I Red Hat I BM

Site Tools

Free Magazines White Papers Top Sites Contributors Site Map FA Q

Practice Tests

Forum Stats

Users online total users: 196

Last Post COMPTIA

Recertification newpolicy

by Burnout01 Jan. 26, 2010 18:59

Board statistics We have a total of

86957 posts!

Sponsored Links

TechTutorials CertifyPro Certnotes Web Host Reviews CBT Training MCITP Boot Camp MCSE Training Computer Training Computer Classes

By Alexis Laliberte

Author 's Foreword

Over the years, I have come to gain a somewhat practical experience about Linux. Working on projects and developingcustom solutions for customers has p rovided a real playground to learn how the thing works. Now I have decided toshare this knowledge with others and have started this study guide as a personal project. During the writing, I havediscovered that I didn’t know lots of things about the nuts and bolts of t he Linux Operating System. Some parts havebeen really easy to write and others have been challenging.

I provide this study guide based on what I have learned and done. If any information contained within might need moreexplanations please feel free to send your comments and questions in the Linux/Unix forum .

I will be pleased to answer you the best I can.

Thanks to Jason Sprague for his support, thanks to all those who have contributed to this guide. Thanks to my girlfriendfor liking the geek in me. Thanks to all my f riends at mcmcse.com.

Alexis Laliberté

1. Concepts

What is Linux?

Linux is a 32 bit open source operating system. It is based on the very popular Unix operating system and it’s code isfreely available (thus explaining the “open source” label as opposed to closed source where the code is not availablefreely). Linux is often referred to as being a “gathering of very cool software”. While this is not a bad description, amore precise definition would reveal that Linux refers to a specific part of the “gathering”. Linux points to it ’s most basicelement: the kernel. Everything else that is bundled with the Linux you get is an application.

Figure 1.1 - Linus Torvalds is the founding father of LinuxPicture by Christopher Gardner

The Linux kernel is the operating system itself. There are different versions and they are released by a non-profitorganization using a version number system. Each time something is added to the kernel, a new beta or experimentalversion is released. Generally, there can be up to 11 latest versions of the kernel available.

The main ones being:

The latest beta version: containing all the new features. This version may contain bugs or unstable code. Ex:2.5.44The latest stable version: this version is recognized as stable and its code is presumed without bug. Ex: 2.4.19The latest prepatched versions: these are Linux alpha version and are being tested before released. Ex: thelatest prepatched version for the beta version could be 2.5.8-pre3The latest patched version: Finally, these are the patched versions for different major releases. They containcorrections to different bug reports and are being t ested.

The last thing to know about kernel versions is the way the numbers are being assigned. For a X.Y.ZZ version, X wouldrepresent a major release version. Y is a minor release version and Z is a patch version number. In other words, whena bug is found and a patch released, only the Z number will change. When a bunch of new features are implemented

Linux+ Study Guide (XK0 -002)

Tutorial Quick Links: Author 's Foreword 1. Concepts 2. Planning the Implementation 3. Installation 4. Configuration 5. Administration 6. System Maintena nce 7. Troubleshooting 8. Identify, Install, and Maintain System Hardware

Sponsor

Sponsor

Training Picks

CareerAcademy Expert-led On-DemandCertification trainingcourses with 7x24 LIVEMentoring. Topics coverMCSE 2008 Training ,A+ Certification , ITSecurity CEH Training ,Cisco Training and manymore.

Training Videos We offer streaming orCD c ertification trainingvideos for Microsoft,CompTIA, Cisco, Citrix,Oracle, CISSP, CET,CWNA, LPI, SCJP, CIW,MOS, PMP and othercertifications. View ourfree videos!

EDULEARN Certification Training onCD-ROMs & Videos:Microsoft MCSETraining , A+Certification , Windows

2003, & Free demos.MCSE certificationtraining includes videosand labs.

Online ComputerTraining by KAlliance. Certificationtraining videos forMCTS, MCITP, OracleOCA/OCP, A+, CCNA,RHCE and more. Our e-learning courses comewith 24/7 onlinementoring.

More Training

Page 1 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 2: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 2/18

and the need to do an upgrade is done, t he Y number is changed and finally, when a collection of upgrades have beendone, when a major improvement or code revision has been done, the X number will be revised. To learn more aboutkernel versions, make sure to visit www.kernel.org .

Here are some examples (at the time of this writing):

Distributions As mentioned before, Linux is often distributed in different formats; there exists many like it, each of them beingbundled with loads of software by different companies or non-profit organizations. These formats are calleddistributions. They include a kernel and a collection of applications, software, wizards and spec ific tools.

Figure 1.2 - The RedHat Linux distribution is amongst the most popular distributions.

Packaging Originally, open source software like Linux was provided as source code. While this had interesting features, onlyhardcore developers could handle, compile and play with the necessary files. Soon, binary files were available andusually shipped with easy to follow instructions to c ompile them. Such instruction are usually found in a Makefile whichis generally a simple set of scripts and instructions.

Even though source code is always available, binary files are now the most current way to handle program installationin Linux. By using special applications, it is possible to handle the installation of binaries without hard user intervention.However, the format in which they are provided can differ from one to another. Especially since some populardistributions have developed their own proprietary systems to resolve packaging problems. For the exam, you shouldknow the major packaging solutions and some of t heir specific attributes. Here are some examples:

Tarball: This is the equivalent of a windows .zip file. Tarball refers to the TAR utility used to build the packages.RPM: (Red hat Package Manager) This package manager was developed by Red Hat and is now being used by a

lot of other distributions. The RPMs carry i nformation about the files dependencies. This means that this systemkeeps information on what files belong to which package. It simplifies the installation of programs becausewhenever you need to install a file, it will tell you what o ther packages should be installed.DEB: (Debian Package handling solution) This solution from Debian is much like the rpm’s except it handles thefile dependencies in a more efficient way, simplifying the installation of patches and upgrades.

Licensing Licensing in the Linux world is quite easy to understand. The software, applications and even the kernel will fall underone of the following license mode:

GPL: Gnu Public License ( www.gnu.org ). Basically, when a programmer decides to place his work under theGNU license, he has an obligation to freely give his sof tware, without charges and to publish all the source code.Only shipping, handling and media can be billed. Whenever the author makes updates to his software, he has topublish it and publish the updated code to the public. Most of Linux falls in this category.

Figure 1.3 - The Gnu logo

BSD: Berkeley software Distribution. BSD is basically the same as GPL except that it is less res trictive as to thedistribution and the and modifications.Freeware: The author of the software is under no obligation to release his code but will let his software go forfree.Commercial software: This kind of licensing is rare in the Linux community. Basically this is when you need tobuy the right to use a software, just like any Windows OS.

Linux Command Prompt The Linux command Prompt is called the Shell. Just as the DOS shell is identified by a group of characters (C:\), theLinux shell is identified by its own set of characters. Many different shells exist. The most commonly used is probablyBash (Bourne Again Shell), but there are many others. Shells will vary with distributions or users' taste.

To find out what your shell is t ype the echo $SHELL command.

The latest stable Linux kernel tree is: 2.4.19

The latest prepatch for the stable Linux kernel tree is: 2.4.20-pre11

The lates t beta vers ion of the Linux kernel is : 2.5.44

The latest prepatch for the beta Linux kernel tree is: 2.5.8-pre3

The lates t 2. 2 vers ion of the Linux kernel is: 2.2.22

The latest prepatch for the 2.2 Linux kernel tree is: 2.2.22-rc3The latest -ac patch to the stable Linux kernels is: 2.4.20-pre10-ac2

The latest -ac patch to the beta Linux kernels is: 2.5.44-ac3

The latest -dj patch to the beta Linux kernels is: 2.5.39-dj2

Page 2 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 3: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 3/18

Figure 1.4 - Using the Shell to identify it

Daemons A daemon is more or less t he Linux equivalent of a windows service. It is an automated process that managesresources, processes, etc.

Man pages The man command is a small command util ity that outputs information about a Linux command. This information isgenerally known as a "man page". To learn more about the man command, simply type man man .

Case Sensitive For many reasons including security reasons, Linux is a highly case sensitive operating system. New users oft enencounter frustration when typing in commands because they tend to forget t his little detail!

2. Planning the Im plemenation

Linux Uses Linux is a pretty flexible operating system. Although it has got a lot of credibility over the years as a stable serverplatform, it is also an excellent desktop platform. Databases, mail servers as well as many appliances can be installed.Choosing the right hardware and applications is important as many different solutions are often available to resolve asame issue. Using the more conventional solutions is often advisable as updates and support will tend to be available.

Hardware Compatibility Linux supports most hardware on the market, with the increasing popularity of the operating system, moremanufacturers are bundling their hardware with Linux drivers. Still, the vast majority of drivers available are coded byLinux users so the more popular your hardware is, the more likely you are to find a driver for it. It is a common ideathat recently released hardware will tend to have less Linux compatibility since most users will code their drivers ontheir spare time.

File System and partitioning Most distributions today have an option to automatically configure file system. However, you should know how toconfigure the file system because server platforms work better w ith customized file partitioning.

First, there are two major tools t o configure system partitions: Disk Druid and FDISK (this is t he Linux FDISK not theDOS/Win version). Disk Druid is probably the easier tool to use but F DISK offers performance and power.

Using these tools, you know have to partition t he drives and assign the proper file system to each partition.

System partitioning will follow different patterns depending on the system you are implementing. It is common sense toplan this accurately in order to get maximum performance. In a way, Linux partitioning is easier than windows becauseit doesn’t rely on letters (A: C: etc). Instead, partitions have names. This allows for better expandability. In theory, youcould only have two partitions: the root partition (represented by a “/”) and the Swap partition. Linux loves Swap spaceand so it performs better on its own partition. Here is an explanation of the different types of partitions:

/boot: Minimum 16m, place for the kernelsSwap: Minimum 128m, place for virtual memory. This should be increased up to the double of ram you have.This is especially important if you are building a database s erver as those are hungry for swap space. Graphicartist workstations will also appreciate a nice wi de Swap partition.

/ : (root) Minimum 250m, place for the basic core of Linux. It includes libraries, system utilities, some programsand the configuration files.

/Var : Minimum 250m, place for the files that change a lot (logs, mail server components and print server spool

files are examples). This should be increased if you are using a server that handles a lot of entries. Mail s erversor computers with a lot o f security auditing are examples here. /usr : Minimum 500m (should be more than 500m), more or les s the equivalent of Program Files, programs andapplications come here. An application server should have a lot of space here.

/home : Minimum 500m (should be more than 500m), again, more or less the equivalent of “My Documents” thisis the place where the users have their files and specific configurations. File servers should be putting a lot of space here since most users tend to fill up their home folders.

These partitions should be using one of the following file syst ems:

Ext2: this is the most common file system for Linux. It offers st ability, file permission and speed although it isvery sensible to power failures or improper shutdowns. The reason is that it caches data before writing it t o disk.In the event of a blackout, the data in the cache might get corrupted. This forces the system to run FSCK on thenext boot to detect corruption.Linux Swap: As its name says, this is the preferred file system for the swap partition.ReiserFS: This is a “newer” Linux file system. It is a journaling file system which basically means that every newentry to the drive gets a corresponding entry in a l og (journal) file. In the event of a power f ailure, the filesystem can rebuild the missing entries instead of going into extensive integrity checking.Ext3: This is supposed to be the next Linux Journaling file system. It i s currently still under development andmay never be adopted since ReiserFS is growing in popularity.

Popular Applications and Services The following are key applications and services used in the Linux world. You should understand what they are used for .

Apache: This is the number one web server for Linux.

BIND: (Berkeley Internet Name Domain) is the most used DNS server on the internet. It is built on a strongarchitecture, it is secure and reliable. ( http:/ / ww w.isc.org/ products/BIND/ )Ipchains: This is used as a firewall, router, gateway, etc. It supports IP masquerading, port filtering andtransparent proxy.KDE: This is a graphical user interface based on the Xwindows system like Gnome ( www.kde.org ).Postfix: A Sendmail alternative with many other options (see also Qmail) ( www.postfix.com )Qmail: A Sendmail alternative with many other options (see also postfi x) ( http:/ / ww w.qmail .org )SAMBA: SAMBA is a SMB client/server application (just as any w indows server) that provides smb file and printservices. In other words it enables a Linux server to become a file server for a Microsoft based network.(www.samba.org )Sendmail: This is a mail transfer agent. Despite what it is called, it doesn’t just send mail. It is a very complete

Page 3 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 4: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 4/18

mail tool that can handle most mail server operations. ( http:/ / ww w.sendmail.org )

Squid: This is used as a proxy server. Its m ain function is to cache frequently accessed and to control access toweb content. ( http:/ / ww w.squid-cache.org )Xwindows or Xfree86: This is a graphical user interface just like Gnome and KDE ( www.Xfree86.org )

Software Availability As you might have seen from the previous sections, most software for Linux is freely available on the internet. Mostdistributions will be also available in stores near you and will usually carry more goodies than the downloadableversions (often including tech support).

Advantages of Choosing Linux

One of the most noticeable features of Linux is it’s free nature. With the high cost of licenses associated withcommercial operating systems, a small priced OS is often more than welcomed by many management staff . However,the most important feature of Linux is its open nature. The fact that the code is available to everybody makes sure thatany bug can be resolved by anyone with the proper skills. Note t hat Linux has also a reputation for having excellentperformance and reliability.

3. Installation

Media Linux installation can be done using a variety of different media. Each installation method has di fferent pros and consdepending on the environment you have. Here are some examples:

Boot disk: The boot disk or boot floppy is generally not an installation technique by itself. You will use a Linuxboot disk in order to launch setup using one of the other media types. These disks are usually provided as floppyimages on the cd-rom itself along with the proper software to copy them on f loppies.CD-Rom: This is the most common type of installation. To do this, you need to have a system that allows for cd-rom booting. You also need a Linux distribution on cd. To start setup, you simply need to insert the cd-rom andstart the computer. The setup should start automatically. If your system does not allow for Cd-rom start up, youcan launch the system using a Linux boot setup disk.Other methods including Http, FTP, NFS and SMB are generally used as an enterprise solution to deploy serversor workstations. All of these methods a re network based and are not necessarily common.

Installation modes Originally, Linux installation was a painful process which could only be done by a small elite group of users. Now, somedistributions are even easier to install than other commercial operating systems.

Once you have launched setup using one media or another, you will be faced with the option to use either a “simple” mode or an “advanced - expert” mode. What this really refers to whether you are going t o use a “graphical userinterface” mode or a “text” mode. The GUI mode is a m ore straight forward process, it i s a wizard like experiencefeaturing point and click menus. On the other side, the text mode will often give you the opportunity to make a morepersonalized installation. The downside of a text installation is its harsh nature.

Figure 3.1 - Installing Linux in text mode

Whichever mode you are going to use, keep in mind that t he best instructions are always the ones that come with yourspecific distribution. Common elements to every distribution generally include:

Setting up the language

Page 4 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 5: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 5/18

Figure 3.2 - Choosing your language

Setting up the Keyboard and mouse

Figure 3.3 - Configuring the keyboard

You will then get to choose which kind of system you want to build. Depending on your choices, the rest of setup willdiffer. A workstation setup is generally straightforward and automatic. On some distributions, a workstation installationwill generate automatic partitioning and will be easier than a server or custom installation.

Figure 3.4 - Choosing what kind of installation should be done

Then, you will get the chance to choose what partitioning scheme you are to use. Automatic partition is the easiest wayto go but not t he preferred way of doing it. If you remember s ection 2 (planning the implementation), you might wantto customize your partitions for your specific needs.

Figure 3.5 - Choosing the partitioning method

Page 5 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 6: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 6/18

You need a good practical understanding of the Fdisk command in order to pass the Linux+ exam. I suggest youpractice this a lot.

Figure 3.6 - Using Fdisk to make partitions

The next step is to configure network settings. The ethx o n the top is the Ethernet adapter. If your network has a DHCPserver, you may want to let the setup to be automatically configured.

Figure 3.7 - Configuring Network settings in GUI mode

During setup, you will be prompted to give the root account a password. I suggest you give a strong password as t his is

the most important account on t he system, the one with all the privileges. It is also recommended to create at least oneuser account.

Figure 3.8 - Creating a user account

If you went through the server or custom setup, yo u will need to configure the packages you want in order topersonalize your installation.

Page 6 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 7: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 7/18

Figure 3.9 - Configuring the packages for a Web Server

Depending on your installation, you may have to configure the Xfree86 engine. To do this you will have t o choose amonitor and configure its vertical and horizontal refresh rate. Choosing a brand name screen will generally ease thisstep as most manufacturers will be listed.

Figure 3.10 - Configuring a custom monitor with its respected refresh rates

If you chose to install your machine as a workstation, you will most likely need to choose a desktop environment suchas KDE or GNOME.

Figure 3.11 - Choosing your desktop environment

Graphical Interface Startup In a lot of distributions nowadays, you might be asked during setup to directly boot into the graphical interface. It isstrongly recommended not to do so for security and stability reasons.

Post-Installation tasks Once the interactive portion of setup is done, the packages will be installed and the kernel will be compiled. Speaking of kernel compilation, it is important that you understand that the Linux Kernel can be compiled at any point after theinstallation and the reasons for that.

Although the kernel shipped with your distribution is probably very good and stable, you have to understand that it isbuilt to work with most hardware and systems available on the market thus making it full of code that you will probablynever use. Therefore recompiling your kernel will enable you to optimize it by picking only what needs to be in it. Otherreasons to recompile a kernel will generally include: upgrading your system, doing hardware changes, adding orremoving features, etc.

After setup is done, you might also want to take a look at t he installation logs to make sure everything went fine. Mostdistributions will have the following logs:

Installing more applications The way that you install additional applications depends on their format. A .gz application format can be installed usingthe gunzip .gz command. A .tar application can be installed using the tar –xvf .tar..tar command. These two commandswill uncompress the files required for installation. You are likely to go through compilation before the applications work.An .rpm file can be installed using the rpm command. For more information on installing and compiling software, checkout Install ing Linux Software .

Location Description

/va r/log Locat io n of most appl icat ion logs

/proc/ Hardware information

/etc/rc.d/ Most system initialization, startup and shutdown logs

/etc/syslog.conf This file contains the name and location of your system log files

Page 7 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 8: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 8/18

Figure 3.12 - Man rpm output

The rpm command has a wide variety of param eters and options. Make sure you know how they work before taking thetest!

4. Configuration

Now that your Linux installation is done and verified, let’s take a look at further customization.

Configuring your Xwindow s No matter what desktop environment you chose, it is most likely that it will use t he Xwindows architecture. This is whyyou should know how to reconfigure your Xwindows using automated utilities such as Xconfigurator and XF86Setup.

Figure 4.1 - Xconfigurator under RedHat

Configuring N etworking Networking, remote access and network clients can be configured using the Linuxconf utility. (Simply enter linuxconf atthe command shell). Specific distributions have optional commands available like RedHat’s Netconfig.

Page 8 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 9: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 9/18

Figure 4.2 - Using Linuxconf in GUI mode

Using Linuxconf, you can do most basic configurations, not only networking, including network server related tasks. Forexample, you can use Linuxconf to do basic NFS configurations like in fi gure 4.3.

Figure 4.3 - Configuring NFS with Linuxconf

Depending on your distribution and the version of Linuxconf you have, you should be aware that limited configuration of the following can be accomplished: X, Samba, NIS, NFS, Apache, SMTP, POP, SNMP, FTP, etc. This includes accessrights for each of those services.

Configuring the Boot Sector Linuxconf will also let you modify the way your system boots by changing LILO (the Linux loader)

Figure 4.4 - Changing Lilo with Linuxconf

Configuring Swap Space In order to work properly, your Linux machine needs some hard disk space t o work with. When your system getsheavily loaded, it may become necessary to increase this space. When you add memory, you will need to increase yourswap space too. The recommended size of your swap space is the double of t he amount of ram memory you have. Inorder to keep things clean, Linux dedicates a partition for this disk space. It is called the Swap partition. To view yourSwap partition, use the cfdisk command.

Page 9 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 10: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 10/18

Figure 4.5 - Viewing Swap space with cfdisk

You can then use cfdisk to delete and create a bigger swap partition. Once this is done, activate it using mkswap.

Configuring printers Configuring printers used to be a real problem in Linux as the printing industry had no r eal standard before Postscriptcame. Today, simple tools exist. Specific tools exist for specific distributions but in many cases, the printtool utilitytends to be a winner. You can also use Linuxconf to configure some printers.

To configure a printer, simply launch the printtool command in your desktop environment (from a shell).

Figure 4.6 - Looking at printer queues with printtool

Install ing other Hardware When it comes to hardware installation, you should always make sure to follow the manufacturer’s instructions. WhileLinux is becoming an easier system to configure, you will generally have to refer to specific recommendations in orderto make sure not too damage your new hardware. The boot process contains a phase where it will try to auto-detect

new hardware and Linuxconf can help you configure new monitors and others.

Editing Configuration Files Linux is mainly configured using simple text files. Interfaces like Linuxconf simplify this kind of configuration but alsolimits the possibilities. This is why you are expected to identify and edit the configuration files. Here are the files andtheir paths:

To edit a text file, simply use VI. You should have a good understanding of the /etc/initab file before t aking the exam.This file enables you to set most environment variables. These are default values fo r specific parameters in your Linux

system (default language, type of shell you are using, etc). It is a very important file! To see your environmentvariables, you can enter the env command.

Co nfiguration file P ath

Red Hat ’s config direc tory /etc/ sysconfig

Sys tem init ia lization f il e /etc/ rc .d /rc .sys init

Suse linux config file /etc/rc.config

Config file for custom commands /etc/rc.d/rc.local

Kernel module initialization file /etc/rc.d/rc.modules

Page 10 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 11: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 11/18

Figure 4.7 - Listing the environment variables with env

Playing with Modules Modules are a part of the operating system that resemble a cross between device drivers and small kernels (sort of).Large parts of the kernel itself could be divided into modules. This would enable you to have a lighter kernel. However,having too many modules would also bring performance problems. Modules take charge of specific functions, generallyperipherals (the USB module, for example, has long been separate from the kernel for stability reasons). To list thecurrently used modules, you use t he lsmod command.

Figure 4.8 - Listing installed modules with lsmod

To install a module, you can use either the insmod or modprobe command. To unload a module from the kernel, youwill use the rmmod command.

5. Administration

As with any other operating system, administration efforts are necessary for any linux system. These include thefollowing tasks:

User Management Linux is a multi user environment which means it is optimized to receive multiple user sessions at the same time (manypeople can connect and interact with the system at t he same time). Therefore, carefully adding, deleting, and modifyingusers is necessary. You can add and delete users using Linuxconf.

Figure 5.1 - Adding and deleting users with Linuxconf

Adding users can also be done using the adduser shell command.

Figure 5.2 - User management using the shell

Linuxconf will also let you modify each of your user accounts.

Page 11 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 12: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 12/18

Figure 5.3 - User management using the GUI

If you want to modify a user's password using the shell, simply type passwd <accountname> .

Figure 5.4 - User management using the shell

Group management is also possible using Linuxconf

Figure 5.5 - Group management using the GUI

Surfing the File System Before giving out permissions to files, you need to be able to navigate through the file system. The first command youmight want to use is the pwd command. This will tell you the folder in which you are currently working in.

Figure 5.6

To list a folder's contents type the ls command. Typing ls -l will display additional attributes about each file and

directory including permissions, file type, size, owner, date and date last modified. For more information on the LScommand, type man ls .

Figure 5.7

The mv command renames and moves files.

Page 12 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 13: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 13/18

Figure 5.8

The rm command removes files

Figure 5.9

To move from a directory to another use the cd command. This command, like many others in Linux, is not far from theones found in MS-DOS. However it is a bit p ickier on syntax. To jump back to the root of the file system, type the cd / command. To move up a directory, type cd .. (make sure to put a space between cd and ..). To move to a specificdirectory, type cd <path/directoryname> .

Using the Super User command Before you can change file permissions, you need to understand that Linux is a very secure environment. It isrecommended to avoid logging in as the root user. Using a regular account you can do most administrative tasks.Whenever privileged use is necessary, simply type the su command. You will then be prompted for t he root passwordand voila! The moment you are done with your tasks, t ype the exit command to stop being a super user.

Figure 5.10 - Man su output

Managing File Permissions Because Linux is a multi-user environment (it allows multiple user to connect to one machine in order to accessresources), it is important to secure it s resources. To view the different permissions associated to files, type the ls –l command.

Figure 5.11

It is absolutely vital that you understand how the permissions work. The permissions are identified by the first column

of characters. Every letter has a specific meaning. The rights column can be interpreted the following way:

A missing permission is represented by a dash (-).

Permissions are given values.

Read = 4Write = 2Execute = 1

O bj ec t ty pe G ro u p r ig h ts O w n er o f f i le ri g ht s O th e rs ' ri g ht s

Charac te r 1 Cha rac ters 2-4 Charac ters 5-7 Cha rac ters 8-10

d = directoryl = link- = file

r = readw = writex = execute

r = readw = writex = execute

r = readw = writex = execute

Page 13 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 14: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 14/18

The command used to give those values is chmod. To give read write and execute to an owner, read and execute togroups and others for a specific file you would type chmod 755 <filename> . If you need further help with permissions,check out this CHMOD Calculator .

Figure 5.12 - Changing test file’s permission with chmod

You can also use chown to change the owner of a file and chgrp to change a file’s group.

Accessing file systems and related devices In order to use a disk device, it needs t o be active or “mounted”. The mount or df command will enable you to seewhich disks are mounted.

Figure 5.13 - The Mount command gives you the mount points and device status

Figure 5.14 The df command gives you physical disk information

This indicates which disks are currently active. The mount command activates on startup. You can access most devicesstarting with the root. Removable devices will be placed under the /mnt folder. However, if you want to mount adifferent cd drive without rebooting the system, you will need t o mount it.

To unmount a device, use the umount command.Managing Remote Systems Linux is a great system when it comes to doing remote administration. You can connect to a remote system using manydifferent techniques. Here are the most common ones:

Telnet: This command will enable you to connect to another computer and establish a shell session. You will thenbe able to enter commands just as if you were directly in front of t he remote computer.Ssh: ssh is more or less t he same thing as telnet except it is a more secure way of doing it. Telnet uses clear textauthentication and no encryption. Ssh is using a more secure authentication mechanism that can even usesecurity public certificates and it then encrypts the whole session.Ftp: The ftp command enables you to connect to a ftp server enabled machine and manage files. This is a verycommon technique on the internet and most people don’t really know about its potential. Ftp stands for FileTransfer Protocol and can move files from one computer to another. It contains many commands that you shouldhave basic knowledge of.You can also redirect an Xwindows session or use a remote desktop software like AT&T’s VNC.

Runlevels and init Think of runlevels as different modes in which linux can operate (just as windows can start in safe mode or regularmode). A runlevel is defined when the computer starts up. When it boots, Linux starts the kernel which loads a firstprocess called init. This process monitors the s ystem run state and then consults the init table (l ocated at /etc/inittab)to start daemons and the other processes. The init table file contains information on the runlevel. There are 7 levels:

Figure 5.15

And as you can see, the default is set to 3. Setting the level to ha lt or reboot will force the computer to shutdown orreboot upon startup (which is not a very good idea unless you want to make a bad prank).

Text Editors

Page 14 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 15: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 15/18

To edit the different Linux configuration files, a simple text editor will do the job. Linux includes many of t hese. Youshould know the most popular of them and their basic functions. VI and EMACS are amongst the most widely used of these tools. To start either of them simply type vi or emacs at the shell.

Using the VI text editor A very important aspect of the Linux file system is to create, edit and save system configuration files. One way to dothis is to use the VI t ext editor. To edit a file, type vi <filename> . To create a file, type vi <new_filename> .

Figure 5.15 - Either VI or VIM will be invoked by the VI command. Both are good text editors

To learn more about VI, I recommend reading the man vi output or reading Using the VI Text Editor

Using the Graphical User Interface

To start the graphical user interface from the shell, type the startx command. Navigating through the GUI is much likeWindows nowadays. You will encounter specific functions depending on the distribution and desktop environment you’vechosen.

Figure 5.16 - A nicely customized KDE desktop in action. Picture courtesy of Sean Parsons.

I recommend you practice using the KDE and Gnome environments before taking the test.

Basic Shell Scripting The most powerful feature of Linux is its s cripting possibilities. It is assumed that you have reasonable knowledge of common script commands in order to pass the Linux+ exam. Here are the main scripting commands that you can use:

Find : As its name implies, the find command is used to locate dif ferent files, folders, etc.grep: This command is useful to search for text contained within files. The output can be put into files, etc. Thiscan be very useful to automate log scavenging and inspection.cut: This is used to be more specific within your searches, to filter the elements you are looking for, etc.

if: The if command is also u sed to screen out information by providing conditions.

6. System M aintenance In order to keep your Linux system running smoothly, it is vital to maintain it properly.

Disk Maintenance To create partitions, you use fdisk or mkfs . To verify disk integrity, use the fsck command.

Scheduling jobs You use the cron command to schedule tasks. Make sure you know how it works before passing the test. The man cronoutput will tell you all you need to know about it.

Page 15 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 16: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 16/18

Network Maintenance To view network statistics and configuration, use the ifconfig command.

System Maintenance and Updates Most Linux distributions like RedHat have automatic update systems now. However, you should know how to use therpm or tgz command to install downloaded packages in case of a problem. The patches are generally available fromyour distribution’s website.

Process M aintenance To view which processes are running, use the ps command. Generally you will type ps –A (capital A - remember thatlinux is case sensitive!)

To kill a process, enter the kill command followed by the process ID (or PID). Use killall to kill all processes.

Backup and Restore Backing up a Linux machine is vital. A lot of t hird party software exists and can make t his process easier. Building abackup script is possible but not a lways recommended since it can represent a lot of work. Check outhttp:/ / ww w.linux-backup.net for more information on the subject.

Maintenance Good Practices As with any other operating system, you should always develop good habits while doing maintenance. More specifically,you should look at the following:

Document the work performed on your Linux systemRegularly monitor the log fil es. Verify errors and any unusual behavior.Verify backups and do restore tests.Perform and check security best practices: change passwords, disable unused resources and accounts, verify filepermissions, isolate important files and lock them down with minimal permissions, do security audits if possible.

7. Troubleshooting In order to make troubleshooting as easy as possible, you should always use an organized methodology. Using simplebest practices will do just t hat.

Best practices

The best tip when it comes to troubleshooting best practices is to document all of your operations. This will provehelpful in critical situation as you will be able to find out about service dependencies, permission issues, etc. Start withquick fixes: if a problem sounds familiar, try u sing a couple of quick tricks. This often addresses the issue. Do not actrandomly: use a proper order to find a problem. E.g. beginning by looking at hardware, then software, looking at recentchanges, looking at logs, asking the user about the nature of t he problem (sometimes the problem can be the user),etc. If all symptoms seem t o point at a c ertain service or process, you can kill and restart it.

You are expected to be able to inspect and determine cause of errors from system log files using such commands aslocate, find, grep, ? , <, >, >>, cat, tail.

A lot of error messages i n linux come from different versions of sof tware and the dependencies associated with them. If you change or update a php package for example, a php based program might stop working. You should use the rpm command to view proper dependencies, document any changes and verify dependencies before making any changes.

Troubleshooting the file system To verify and repair a file system, you can use the mount command to enumerate the different partitions on the systemand the fsck command to repair them.

You can use the DF command to see the space used on each disk. Problems can occur when a disk is full.

Page 16 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 17: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 17/18

Troubleshooting the boot process Even with the strongest file systems, failure will happen. You may encounter situations where the system boots insingle user mode. This is an operating mode that doesn’t start all daemons and is useful for troubleshooting. In thismode you will be given the opportunity to use dif ferent troubleshooting tools including file system integrity using fsck .In the case where a system won't boot, it is a good idea to boot from a floppy and inspect the filesystem and bootsector. A boot disk should always contain fsck as it will enable you to repair and rescue a damaged file system.

Troubleshooting backup and restore errors Backups can fail for many reasons. The most common causes are media and drive related issues. Most media requiresproper maintenance and cleaning. Tape corruption, low device space or write failures are common problems.Proprietary software will have specific error messages and you should refer to your software provider to verify t hem.Backups should always be handled with care. You should do a regular restore test as it is not uncommon to seesuccessful backups that cannot be successfully restored.

Troubleshooting Netw orking Linux, being based on one of the oldest network operating systems (UNIX), is loaded with standard troubleshootingtools. Some of these tools are:

Ping: the ping utility enables you to verify basic connectivity between two machines.

Route: the route utility helps you take a look at the various routes defined within the Kernels routing table. Youwill be able to add, delete, and modify routing information here. This is very helpful when using your Linux box

as a router or firewall.

Traceroute: this utility enables you to see every router between your Linux machine and a given host. This way itis possible to see any failing point between you and t his host.

Netstat: this utility helps you see your network interfaces statistics.

Lsof: this utility lets you see any open f iles.

Ifconfig: this utility lets you see your network interfaces and modify certain settings.

Finding Help Linux has one of the largest communities when it comes to finding friendly support. Linux has specific terms when itcomes to help. Here are a couple:

Howto: A howto is a detailed procedure for a specific topic regarding Linux. You can find a howto to help youimplement just about any Linux software or Linux service. A great site about those can be found athttp:/ / ww w.tldp.org .Infopages: Those are really popular in northern Europe and they are filled with useful information. The hard partis finding one in English!ManPages: Although manpages are available in the shell, you are likely to find updated versions of t hem all

Page 17 of 18CompTIA Linux+ Study Guide

1/27/2010http://www.mcmcse.com/comptia/linux/studyguide.shtml

Page 18: Comptia Linux Study Guide

8/8/2019 Comptia Linux Study Guide

http://slidepdf.com/reader/full/comptia-linux-study-guide 18/18

IT Showcase

around the Web.NHF: Newbie Help Files. NHF’s are an initiative of justlinux.com (previously linuxnewbie.org). They are e asy tounderstand tutorials that will help new users understand the nuts and bolts about specific linux topics. You willfind NHF’s at http:/ / ww w.justl inux.com/ nhf/ .Forums: remember that you can always post your questions our forums .

8. Identify, Install, and Maintain System Hardw are

Coming Soon!!!

ADVERTISE | PARTNERSHIPS | PRIVACY POLICY | DISCLAIMER | ©1998-2010 | CONTACT

Page 18 of 18CompTIA Linux+ Study Guide


Recommended