- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
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!
Lab 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
scpcommand options.- Confirm the proper command syntax for the
scpcommand, using either themanorinfocommands.
- Confirm the proper command syntax for the
- Use
scpto 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
scpto copy the.bashrcfile to the/home/cloud_userdirectory on the secondary system.
- Use
scpto copy a remote file to the local system.- Download the
/home/cloud_user/build/devsys12-account-audit.logfile from the secondary system to theauditdirectory 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.devopsadminshelpdeskadmins
- Using
- Add users to the new groups.
- Add the following user accounts to the
devopsadminsgroup.- Peter Gibbons
- Michael Bolton
- Samir Nagheenanajar
- Add the following user accounts to the
helpdeskadminsgroup.- Milton Waddams
- Tom Smykowski
- Add the following user accounts to the
- Grant superuser privileges using the new groups.
- Use the
visudocommand to create a new file in the/etc/sudoers.ddirectory and call the file20-groups. - Add the following group configurations to the file.
- The
devopsadminsgroup should be able to connect from any host, act as the root user and be able to run any command. - The
helpdeskadminsgroup should be able to connect from any host, act as the root user and only run thelsandcatcommands.
- 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
devopsadminsgroup. As the user, attempt to run the following commands with elevated privileges.- List the contents of the root user's home directory.
- Use the
catcommand to view the/etc/sudoersfile. - Use the
lesscommand to view the/etc/sudoersfile. - Exit the user session and return to the
cloud_useraccount.
- Use the
su -command to switch to one of the users from thehelpdeskadminsgroup. As the user, attempt to run the following commands with elevated privileges.- List the contents of the root user's home directory.
- Use the
catcommand to view the/etc/sudoersfile. - Use the
lesscommand to view the/etc/sudoersfile. - Exit the user session and return to the
cloud_useraccount.
- 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
mkdircommand, create a directory calledarchives. - Using the
lncommand, create a softlink to/var/logand call itlogfiles.
- Using the
- Create and copy files to the
archivesdirectory.- Copy the
messagesandsecurelog files to thearchivesdirectory, using thelogfilessoftlink as the source. - Use output redirection to send the contents of
/etc/passwdand/etc/groupto a file calledaudit.login thearchivesdirectory. - Send a list of the
/var/logdirectory contents to a file calledloglist.txtin thearchivesdirectory.
- Copy the
- Create a
tararchive of thearchivesdirectory, add a file to the archive and compress the it.- Use the
tarcommand to create tarball of thearchivesdirectory. - Add the
.bashrcfile to the tarball. - Use
gzipto create a compressed archive, preserving the originaltararchive.
- Use the
- Create the team directory, configure ownership & permissions and restrict access.
- Create a directory called
devopsin the/datadirectory. - 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/devopsdirectory. - Switch to the
pgibbonsuser 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_useraccount.
- Switch to the
mboltonaccount.- Attempt to change to the devops directory.
- Attempt to rename the
pgibbons-testfile tombolton-test. - Attempt to delete the
pgibbons-testfile. - Exit the session and return to the
cloud_useraccount.
- 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
mariadbservice status. - Use
systemctlto stop themariadbservice. - Mask the
mariadbservice usingsystemctl. - Attempt to start the
mariadbservice 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/journaldirectory exists. - Create the
/var/log/journaldirectory. - Confirm journal data is being written to the directory.
- Update the
journaldconfiguration to limit the size of journal files to50M.
- Check to see if the
- Install
PostgreSQLusing the newest module stream.- Use
yum moduleto install the newestPostgreSQLstream. - Review the status of the
PostgreSQLservice to confirm it is installed.
- Use
- Remove an installed package from the system.
- Check to see if
MariaDBis installed. - Use
yumto uninstall theMariaDBpackage.
- Check to see if
- Use the
rpmcommand to install a local rpm package.- Check to see if the package for
wgetis installed. - Use
rpmto install thewgetpackage located in the cloud_user's home directory. - Confirm
wgetis 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
hostnamectlto 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/hostsfile, using the local IP Address and the valuerh8lab. - Ping
rh8labto confirmhostsentry works. - Use
nmclito view network connections. - Add the DNS server 8.8.8.8 to the default connection,
System eth0. - Reload the interfaces and cycle the
NetworkManagerservice to pickup the changes. - Confirm the
/etc/resolv.confcontains the new DNS server.
- Add a line to the
- Drop and recreate the secondary network connection.
- Use
nmclito 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.
About the author
Real skill practice before real-world application
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.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.