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
    • Security
Google Cloud Platform icon
Labs

Working with Linux Accounts and Password Policies

In this lab, we will learn how to configure Linux accounts and security policies. Specifically, we will set password requirements, configure account lockout settings, and create a temporary user account that will expire on a pre-determined date.

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

Contact sales

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

    Set up password requirements on a Linux host.

    Set the minimum password length to 12 characters:

    1. Run the command sudo nano /etc/pam.d/common-password.
    2. At the end of the first uncommented line (line 25) add minlen=12, one space after sha512.
    3. Save the file and exit nano.

    Set the maximum password age to 180 days and the minimum password age to 3 days:

    1. Run the command sudo nano /etc/login.defs.
    2. Search for 99999 (press Ctrl + W to search).
    3. Replace 99999 with 180.
    4. On the next line down, replace the 0 with 3.
    5. Save the file and exit nano.
  2. Challenge

    Configure the account lockout settings on a Linux host.

    Configure accounts to lock out after 3 failed logins and remain locked out for 10 minutes. Do not configure the root account to lock out after any amount of failed login attempts.

    1. Run the command sudo nano /etc/pam.d/common-auth.
    2. Add a line above the first non-commented line and add the following code: auth required pam_tally2.so onerr=fail deny=3 unlock_time=600 audit
  3. Challenge

    Create a temporary user account.

    The temporary account name should be contractor1, and it should expire one week from today.

    1. Run the following command:
    sudo adduser contractor1
    
    1. Provide a password for the account.
    2. Run the following command (replace <YYYY-MM-DD> with the date for one week from today):
    sudo chage -E "&lt;YYYY-MM-DD>" contractor1
    
    1. Verify that the account expiration is correctly configured by running the following command and checking the Account expires date:
    sudo chage -l contractor1
    
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