Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Working with Essential Red Hat Linux System Administration Tools

In this lab we are going to make sure we have the minimum knowledge required to successfully pass the RHCE on RHEL8. We're going to present a scenario that will test an exam candidate's knowledge of how to use `grep` and configure `ssh` to help students succeed at this exam. *This course is not approved or sponsored by Red Hat.*

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 23, 2025
Duration
15m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Find the Username That the Other Admin Created

    There are over 25,000 lines in /tmp/logfile so we don't want to do it by hand. While we don't know the exact format we're searching for, we're fairly confident that it's some form of the word "username".

    grep -e 'user.*name' -i /tmp/logfile

    That will match any iteration of 'user', followed by any character (or no character), followed by 'name'.

  2. Challenge

    Create an SSH Key

    Use the command ssh-keygen to generate a key that we can use to copy to the other server to allow passwordless connections.

  3. Challenge

    Copy the SSH Key to Both cloud_user and the User Whose Name You Discovered in the First Task

    Use the ssh-copy-id command to copy the SSH key to both the cloud_user and the new user name:

    [cloud_user@Server1 ]# ssh-copy-id cloud_user@&ltServer2_INTERNAL_IP_ADDRESS>
    [cloud_user@Server1 ]# ssh-copy-id &ltUSERNAME>@&ltServer2_INTERNAL_IP_ADDRESS>
    

    Now we can test with two ssh commands:

    ssh cloud_user@&ltServer2_INTERNAL_IP_ADDRESS&gt
    

    Back out of that login, and try it for the other user:

    ssh &ltUSERNAME&gt@&ltServer2_INTERNAL_IP_ADDRESS&gt
    

    Just be sure you've substituted the correct Server2_INTERNAL_IP_ADDRESS and USERNAME in the commands. We should now be able to perform passwordless ssh logins.

  4. Challenge

    Ensure That No One Can Use a Password to Log into Server2

    Now get out of that shell and come back in as cloud_user. Once we've logged in, we need to edit /etc/ssh/sshd_config and, with whichever text editor we like best, change the PasswordAuthentication variable to no. We're using vi as an example here:

    [cloud_user@Server2 ]# sudo vi /etc/ssh/sshd_config
    

    Once we've done that, restart the SSH daemon using sudo systemctl restart sshd.

    To test, try to log in with a password:

    [cloud_user@Server2 ]# ssh -o PreferredAuthentications=password cloud_user@localhost
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

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.

Get started with Pluralsight