Skip to main content

Command Palette

Search for a command to run...

Day 2/100 of DevOps

Temporary User Setup with Expiry

Updated
•1 min read•View as Markdown

Task: Create a user named “jim” on App Server. Set the expiry date to 2024-02-17, ensuring the user is created in lowercase as per standard protocol.

  1. SSH into App Server

    ssh tony@stapp03

  1. Check if the user is already present or not.

    id jim

  1. Switch to root user

    sudo -i or sudo su -

  1. Create/ Add the user and verify it with usind id command

    useradd jim

    id jim

  1. Use chage command with -l

    Chage command is used for monitoring and changing the user password expiry date.

    -l option lists all current password aging details of a user.

    Here, the account expires is never.

  1. To set the expiry for the user

    chage -E 2024-02-17 jim

    Now, again verify using chage -l command:

    chage -l jim

    Now, you can see Account Expires has been changed to the mentioned date.

Note: You can use chage -help command to see other options that can be used with chage command.