RHCSA
7RHCE
Red
Haf
Linux Certification
Practice
Exams with
Virtual Machines
(Exams
EX200
&
EX300)
"IcGraw-Hill isanindependent entityfrom RedHat, Inc.,and isnotaffiliated with Red Hat, Inc. in
iny manner.Thispublicationand DVD may be usedinassistingstudentstoprepare foraRed Hat
CertifiedEngineerExamor a RedHat CertifiedSystemAdministratorExam. Neither Red Hat,Inc. lorMcGraw-Hillwarrantthatuseof thispublicationwillensurepassingtherelevantexam.Red
Hat®,Red Hat®Linux®,RedHat®EnterpriseLinux®,RHCE®,RHCT and RHCSAareeither
egisteredtrademarksortrademarks of RedHat,Inc.inthe United States and/or othercountries.
Thispublicationisnotintendedtobeasubstitute for the Red Hat RHCSA prepcourse,RH200,
orthe RHCE prepcourse,RH300.Thisstudy/training guideand/or material isnotsponsored by,
endorsedby,oraffiliated with RedHat,Inc.inanymanner.
Michael
Jang
CONTENTS
About the
Contributors ivAcknowledgments
xvPreface
xviIntroduction xxiii
I
Prepare
for Red
Hat Hands-on
Certifications
IThe RHCSA
and RHCEExams
4The
ExamExperience
4
The
RHCSA
Exam 5The RHCE
Exam
5
Evolving
Requirements
6Basic
Hardware
Requirements
6Hardware
Compatibility
7RAM
Requirements
8Hard Drive
Options
8Get
Red HatEnterprise
Linux 8The
Point Releases Don'tMatter
9The Choices
9Purchase an
RHEL
6Subscription
10GetanEvaluation
Copy
10
Putting
RHEL 6 toWork 10Third-Party
Rebuilds
11Installation
Requirements
12Red
Hat
andVirtual Machines
13Virtual and
Physical
Systems
14Installation
Options
14
Boot
Media
15Booting
the RHEL
6Installation
15Basic Installation
Steps
16
Default
Security Settings
25
Install
Virtual Machines from the DVD 28A Preinstalled
Environment for PracticeLabs
32Viii
RHCSA/RHCE Red Hat Linux Certification PracticeExams with Virtual MachinesConfigure
aPhysical
Machine for Virtual Guests34
A Default
Configuration
FTP Server35
A Default
Configuration
HTTP Server
36Q&A
Self
Test 38Lab
Questions
39Self Test Answers 42
Lab
Answers43
2
Virtual Machines and Automated Installations
47
Start
andStop
Virtual Machines48
Starting
andStopping
VMs from the
Command Line 48Starting
and
Stopping
VMs from the GUI 49Configure Systems
to Start Virtual MachinesatBoot49
Accessa
Virtual
Machine'sConsole
51Access Remote
Systems Using
SSH 51Install Red Hat
Enterprise
LinuxSystems
asVirtual Guests 51Install
Red HatEnterprise
LinuxAutomatically Using
Kickstart
52Q&A
Self
Test 55Lab
Questions
56Self Test Answers 57
Lab Answers
58
3
Fundamental Command-Line Skills
61AccessaShell
Prompt
and
IssueCommands
with CorrectSyntax
... 62Use
Input/Output
Redirection
63Create,
Delete, Copy,
and Move Files and Directories 63Create Hard and Soft Links
64
Use grep and
Regular Expressions
toAnalyze
Text64
Locate, Read, and
UseSystem
Documentation 65Create and
Edit
TextFiles
66
Start,
Stop,
and
Check the Status of Network Services67
Configure Networking
and HostnameResolution
67
Q&A
Self Test 70Lab
Questions
71Self
Test Answers 72Contents
|x
4 RHCSA-Level
Security Options
77
List, Set,
andChange
Standardugo/rwx
Permissions 78Diagnose
and Correct File PermissionProblems
79
Create
and
Manage
AccessControl
Lists(ACLs)
80Configure
Firewall
Settings Using
system-config-firewall
oriptables
. . 80Set
Enforcing
and Permissive Modes for SELinux 81List and
Identify
SELinux File and Process Context 82Restore
Default
File Contexts 83Use
Boolean
Settings
toModify System
SELinuxSettings
84Diagnose
and
Address Routine SELinuxPolicy
Violations 84Q&A
Self Test87
Lab
Questions
88Self
Test Answers 89Lab Answers 90
5 The
Boot
Process 95Boot, Reboot,
and Shut DownaSystem Normally
96Boot
Systems
intoDifferent Runlevels
Manually
97
Use
Single-User
Mode
toGain
Accessto aSystem
98Configure
Systems
to Boot IntoaSpecific
RunlevelAutomatically
.. 99Configure
Network ServicestoStartAutomatically
atBoot 100Modify
theSystem
Bootloader
101Q&A
SelfTest
103Lab
Questions
104Self
Test
Answers105
Lab Answers 106
6
Linux
Filesystem
Administration
109
Add New
Partitions,
Logical
Volumes,
andSwap
to aSystem
Non-Destructively
IllList, Create,
Delete,
and Set PartitionType
forPrimary, Extended,
and
Logical
Partitions IllX R.HCSA/RHCERed Hat Linux Certification PracticeExams with Virtual Machines
Mount
and Unmount CIFSand NFS Network File
Systems
115Configure Systems
toMount FileSystems
atBootby Universally
Unique
ID
(UUID)
orLabel 115Create
andConfigure
LUKS-encrypted
Partitionsand
Logical
Volumesto
Prompt
forPassword and
MountaDecrypted
File
System
atBoot 116Mount, Unmount, and
UseLUKS-encrypted
FileSystems
117Configure Systems
to Mountext4,
LUKS-encrypted,
andNetwork File
Systems Automatically
118Q&A
Self Test 120Lab
Questions
122Self Test
Answers 123Lab Answers 125
7
Package Management
129
Install and
Update
Software
Packages
from Red
HatNetwork,
aRemote
Repository,
orfrom the Local
FileSystem
130Update
theKernel
Package Appropriately
toEnsureaBootable
System
131Q&A
Self
Test 133Lab
Questions
134
Self Test Answers 135
Lab
Answers135
8
User Administration
137
Log
Inand Switch Users
inMultiuser Runlevels138
Create, Delete,
andModify
Local Users Accounts 139Change
Passwords andAdjust
PasswordAging
for Local User
Accounts 139
Create, Delete,
andModify
Local
Groups
and
Group Memberships
..140
Create
and
Configure
set-GID
Directories for Collaboration141
Configure
aSystem
toUse
anExisting
LDAPDirectory
Servicefor
User and
Group
Information142
Q&A
Self Test144
Lab
Questions
145
Self Test Answers
146
Contents
xi
9
RHCSA-Level
System
Administration
Tasks
151Access Remote
Systems Using
VNC 152Archive, Compress,
Unpack,
and
Uncompress
FilesUsing
tar, star,gzip,
andbzip2
152Identify CPU/Memory
IntensiveProcesses;
Adjust
ProcessPriority
with
renice, kill Processes153
Schedule Tasks
Using
cron154
Locate
and
Interpret
System Log
Files
155
Q&A
SelfTest157
Lab
Questions
158
Self
TestAnswers
159Lab Answers
16010
A
Security
Primer
163
Use
iptables
toImplement
PacketFiltering
andConfigure
NetworkAddress
Translation(NAT)
164
Configure
Host-Based andUser-Based
Security
for theService
165Q&A
SelfTest
168Lab
Questions
169
Self Test
Answers
170
Lab Answers 171
11
System
Services and
SELinux
175
Install the
Packages
NeededtoProvide the Service
176
Configure
the Service
toStart Whenthe
System
Is Booted 177Configure
SELinux
toSupport
the Service178
Configure
Key-Based
Authentication
179
Configure
Additional
Options
Described
inDocumentation 180Q&A
SelfTest
182Lab
Questions
183
Self Test
Answers
184
Xii
RHCSA/RHCERed Hat LinuxCertification Practice Examswith Virtual MachinesUse
/proc/sys
and
sysctl
toModify
and
Set Kernel Run-TimeParameters
191Builda
Simple
RPM thatPackages
aSingle
File 192Configure System
as aniSCSI Initiator thatPersistently
Mountsan
iSCSI
Target
194
Configure System
toAuthenticate
Using
Kerberos
195Route IP traffic and Create Static Routes 196
Q&lA
Self
Test 198Lab
Questions
199Self Test Answers 200
Lab Answers 201
13
Electronic Mail Servers
205
Install the
Packages
Neededto Providethe
Service 206Configure
SELinuxtoSupport
the Service 207Configure
the Service
toStart When the
System
IsBooted
207Configure
the Service for
BasicOperation
208Configure
Host-Based and User-BasedSecurity
for theService
208Configure
aMail TransferAgent (MTA)
toAccept
Inbound E-mailfrom other
Systems
209Configure
anMTAtoForward
(Relay)
Through
aSmart Host 210Q&A
SelfTest 212Lab
Questions
213Self Test Answers
214
Lab Answers 215
14
The
Apache
Web Server
219
Install the
Packages
Needed
toProvidethe
Service 220Configure
SELinux toSupport
the
Service 221Configure
the
ServicetoStartWhen the
System
Is Booted 223Configure
theService for Basic
Operation
223Configure
Host-Based
andUser-Based
Security
for the Service
224Configure
aVirtual Host 225Configure
Private Directories226
Deploy
aBasic CGIApplication
227
Contents
xiH
Q&A
Self
Test 229Lab
Questions
230Self Test
Answers
231Lab Answers 232
15
The
Samba
File Server
239
Install
the
Packages
Neededto Provide the Service 240Configure
SELinux toSupport
the
Service240
Configure
the ServicetoStart When the
System
Is Booted242
Configure
the
Service for BasicOperation
242
Configure
Host-Based and
User-BasedSecurity
for the Service 243Provide Network Sharesto
Specific
Clients244
Provide
Network SharesSuitable for
Group
Collaboration
245
Q&A
Self
Test247
Lab
Questions
248Self Test
Answers
249
Lab Answers 250
16
More
File-Sharing
Services
253
Install the
Packages
NeededtoProvide the Service254
Configure
SELinux
toSupport
the
Service254
Configure
theService
toStart When the
System
Is Booted255
Configure
the Service for BasicOperation
256Configure
Host-Based andUser-Based
Security
forthe Service
256
Configure
Anonymous-Only
Download foranFTP Server257
Provide NFS Network Shares
toSpecific
Clients258
Provide NFS
Network
SharesSuitable for
Group
Collaboration 259Q&A
Self Test 260Lab
Questions
261Self
Test Answers262
Lab
Answers
263
XiV
RHCSA/RHCE Red Hat LinuxCertification Practice Exams with Virtual MachinesConfigure
aSystem
toAccept Logging
fromaRemoteSystem
270Install the
Packages
Needed
toProvide the
Service 271Configure
SELinux
toSupport
the Service271
Configure
the ServicetoStart When theSystem
Is Booted 272Configure
the Service for BasicOperation
272Configure
Host-Based and User-Based
Security
forthe Service
273
Configure
aCaching-Only
Name Server273
Configure
aCaching-Only
Name ServertoForward DNSQueries
.. . 274Synchronize
TimeUsing
Other NTP Peers 275Q&A
Self Test
277
Lab
Questions
278
Self Test Answers 279
Lab
Answers 280A
Prepare
aSystem
for the
Sample
Exams
285
Basic
Sample
ExamSystem
Requirements
287
Additional
Sample
ExamSystem Requirements
for the RHCE 289B
RHCSA:
Sample
Exam I
291
RHCSA
Sample
Exam 1 Discussion 293C
RHCSA:
Sample
Exam 2
297
RHCSA
Sample
Exam 2 Discussion 299D
RHCE:
Sample
Exam
I303
RHCE
Sample
Exam
1Discussion
305
E
RHCE:
Sample
Exam2
309
RHCE