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

Set Up Local Email Forwarding

A Linux system administrator should have a basic understanding of working with local email accounts. Many services will forward email messages to the local administrator (`root`) containing notifications about tasks and other relevant system information. Understanding how to forward an email on a local system is important in making sure that a system administrator does not miss out on any essential information. This learning activity will assist you in developing the skills necessary to set up local email forwarding on a system and learning how to access that email.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Apr 06, 2025
Duration
1h 30m

Contact sales

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

    Set up the Alias
    1. Log into the server, and switch to the root user.

      sudo su -

    • Run the following command to add an alias to all mail destined for the root user so that it will instead get sent to the cloud_user account:

      echo "root: cloud_user" >> /etc/aliases

  2. Challenge

    Re-generate the Aliases Database File

    Run the following command to re-generate a new /etc/aliases.db file so that your new email alias rule gets registered:

    newaliases
    
  3. Challenge

    Send a Test Email

    Generate an email to test your new forwarding rule. You can use the following command to send a copy of the /etc/services file as an email attachment, along with the subject line "Just Testing" to the local 'cloud_user' account:

    mail -s "Just Testing" -a "/etc/services" cloud_user@localhost < /dev/null
    

    We are using a null message body, as we are just checking for the attachment.

  4. Challenge

    Read the Email, Then Remove It

    Go back to the 'cloud_user' account, and run the mail command to view the cloud_user's email message:

    mail
    

    The message sent from the root user should be in the list. Press the number corresponding to the message (typically '1') and then press enter. After you have finished reviewing the message (you can press the spacebar to scroll through the attachment), press the Q key to close the message, then press the D key at the ampersand (&) prompt to delete the message. Finally, press the Q key to quit out of the mail application.

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