- Lab
- A Cloud Guru
Practice Exam Lab for PE124
*This course is not approved or sponsored by Red Hat.* This hands-on lab is built around the objects identified by Red Hat for the `Preliminary Exam in Red Hat System Administration I (PE124)`. The PE124 exam is a practical, scenario-based exam. This lab is not an exact copy of the exam; however, it is designed to provide possible tasks and situations that you might encounter when taking the exam. The lab will cover scenarios across five main objectives with numerous individual tasks. The lab will have a 1.5-hour time limit, while the actual `PE124` exam will only allow 1 hour. Your ultimate goal should be to complete this lab in 1 hour or less to stay in line with the exam. Practice with this lab as many times as necessary to make sure you are comfortable with the tasks and time limits. Good luck with your studies!
Path Info
Table of Contents
-
Challenge
Accessing Systems and Information
- Connect to the primary Red Hat system.
- Collect the IP Address, user account, and password for the primary system.
- Use this information to connect to the system using
ssh
.
- Review the
scp
command options.- Confirm the proper command syntax for the
scp
command, using either theman
orinfo
commands.
- Confirm the proper command syntax for the
- Use
scp
to copy a local file to the secondary Red Hat system.- With the proper syntax in mind, collect the IP Address, user account and password for the secondary system.
- Using these credentials and the proper command syntax, use
scp
to copy the.bashrc
file to the/home/cloud_user
directory on the secondary system.
- Use
scp
to copy a remote file to the local system.- Download the
/home/cloud_user/build/devsys12-account-audit.log
file from the secondary system to theaudit
directory on the primary system.
- Download the
- Connect to the primary Red Hat system.
-
Challenge
User and Group Management
- Add 5 users to the system.
- Add the following user accounts to the system. Set the comment option to the user's full name and user ID to the value provided.
- Peter Gibbons, User name = pgibbons, User ID = 20001
- Michael Bolton, User name = mbolton, User ID = 20002
- Samir Nagheenanajar, User name = snagheenanajar, User ID = 20003
- Milton Waddams, User name = mwaddams, User ID = 20004
- Tom Smykowski, User name = tsmykowski, User ID = 20005
- Set to the default password for each account to
initech123
.
- Add the following user accounts to the system. Set the comment option to the user's full name and user ID to the value provided.
- Add 2 groups to the system.
- Using
groupadd
, add the following groups to the system.devopsadmins
helpdeskadmins
- Using
- Add users to the new groups.
- Add the following user accounts to the
devopsadmins
group.- Peter Gibbons
- Michael Bolton
- Samir Nagheenanajar
- Add the following user accounts to the
helpdeskadmins
group.- Milton Waddams
- Tom Smykowski
- Add the following user accounts to the
- Grant superuser privileges using the new groups.
- Use the
visudo
command to create a new file in the/etc/sudoers.d
directory and call the file20-groups
. - Add the following group configurations to the file.
- The
devopsadmins
group should be able to connect from any host, act as the root user and be able to run any command. - The
helpdeskadmins
group should be able to connect from any host, act as the root user and only run thels
andcat
commands.
- The
- Use the
- Validate superuser access for at least two of the accounts, one from each group.
- Switch to one of the users from the
devopsadmins
group. As the user, attempt to run the following commands with elevated privileges.- List the contents of the root user's home directory.
- Use the
cat
command to view the/etc/sudoers
file. - Use the
less
command to view the/etc/sudoers
file. - Exit the user session and return to the
cloud_user
account.
- Use the
su -
command to switch to one of the users from thehelpdeskadmins
group. As the user, attempt to run the following commands with elevated privileges.- List the contents of the root user's home directory.
- Use the
cat
command to view the/etc/sudoers
file. - Use the
less
command to view the/etc/sudoers
file. - Exit the user session and return to the
cloud_user
account.
- Switch to one of the users from the
- Add 5 users to the system.
-
Challenge
Managing Files and Directories
- Create an archive directory and softlink in your home directory.
- Using the
mkdir
command, create a directory calledarchives
. - Using the
ln
command, create a softlink to/var/log
and call itlogfiles
.
- Using the
- Create and copy files to the
archives
directory.- Copy the
messages
andsecure
log files to thearchives
directory, using thelogfiles
softlink as the source. - Use output redirection to send the contents of
/etc/passwd
and/etc/group
to a file calledaudit.log
in thearchives
directory. - Send a list of the
/var/log
directory contents to a file calledloglist.txt
in thearchives
directory.
- Copy the
- Create a
tar
archive of thearchives
directory, add a file to the archive and compress the it.- Use the
tar
command to create tarball of thearchives
directory. - Add the
.bashrc
file to the tarball. - Use
gzip
to create a compressed archive, preserving the originaltar
archive.
- Use the
- Create the team directory, configure ownership & permissions and restrict access.
- Create a directory called
devops
in the/data
directory. - Update the ownership to
nobody:devopsadmin
. - Update directory permissions to the following configuration:
- owner/group = read, write, execute
- other = none
- Enable SGID
- Enable the Sticky bit
- Create a directory called
- Validate access to the directory.
- As the
cloud_user
, attempt to change to the/data/devops
directory. - Switch to the
pgibbons
user account.- Attempt to change the devops directory.
- As pgibbons, attempt to create a file called
pgibbons-test
. - Exit the session and return to the
cloud_user
account.
- Switch to the
mbolton
account.- Attempt to change to the devops directory.
- Attempt to rename the
pgibbons-test
file tombolton-test
. - Attempt to delete the
pgibbons-test
file. - Exit the session and return to the
cloud_user
account.
- As the
- Create an archive directory and softlink in your home directory.
-
Challenge
Systems Management
- Stop and mask a service to prevent it from starting.
- Check the
mariadb
service status. - Use
systemctl
to stop themariadb
service. - Mask the
mariadb
service usingsystemctl
. - Attempt to start the
mariadb
service to confirm it is properly masked.
- Check the
- Determine if journals are configured to be persistent and update the configuration if necessary.
- Check to see if the
/var/log/journal
directory exists. - Create the
/var/log/journal
directory. - Confirm journal data is being written to the directory.
- Update the
journald
configuration to limit the size of journal files to50M
.
- Check to see if the
- Install
PostgreSQL
using the newest module stream.- Use
yum module
to install the newestPostgreSQL
stream. - Review the status of the
PostgreSQL
service to confirm it is installed.
- Use
- Remove an installed package from the system.
- Check to see if
MariaDB
is installed. - Use
yum
to uninstall theMariaDB
package.
- Check to see if
- Use the
rpm
command to install a local rpm package.- Check to see if the package for
wget
is installed. - Use
rpm
to install thewget
package located in the cloud_user's home directory. - Confirm
wget
is installed by checking the version.
- Check to see if the package for
- Stop and mask a service to prevent it from starting.
-
Challenge
Networking
- View and update hostname information.
- Use
hostnamectl
to view hostname details. - Set a new hostname,
pe124lab
, for the system. - Set a
pretty name
,PE124 Lab Server
, for the system. - Confirm new values were updated using
hostnamectl
.
- Use
- Update name resolution.
- Add a line to the
/etc/hosts
file, using the local IP Address and the valuerh8lab
. - Ping
rh8lab
to confirmhosts
entry works. - Use
nmcli
to view network connections. - Add the DNS server 8.8.8.8 to the default connection,
System eth0
. - Reload the interfaces and cycle the
NetworkManager
service to pickup the changes. - Confirm the
/etc/resolv.conf
contains the new DNS server.
- Add a line to the
- Drop and recreate the secondary network connection.
- Use
nmcli
to view network connections. - Delete the secondary connection,
Wired connection 1
. - Recreate the connection with the following details.
- Name: New connection
- Interface name: eth1
- Type: ethernet
- IP Address: 10.0.10.10
- Gateway: 10.0.10.1
- Confirm the connection was created.
- Confirm the new interface has the correct IP Address.
- Use
- View and update hostname information.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.