Skip to main content

Command Palette

Search for a command to run...

100 Days of DevOps – Day 2: Creating a Temporary User with Expiry Date

How to Create a Temporary User with an Expiry Date in 100 Days of DevOps

Updated
2 min read
100 Days of DevOps – Day 2: Creating a Temporary User with Expiry Date
G

Hey! I’m Vishal Gurjar, a passionate DevOps Engineer skilled in automation, CI/CD, and cloud-native applications. 💡 Skilled in Docker, Kubernetes, Jenkins, AWS, GitHub Actions, and Linux. 🔨 Built real-world DevOps projects like Robot Shop & Netflix Clone with scalable pipelines. 📚 Documenting my journey through blogs/tutorials to help others learn faster. 🤝 Open to collaborations, freelancing, and exciting DevOps opportunities.

ask for the Day

Today’s challenge was about User Management in Linux.
I had to create a temporary user named anita on App Server 1 in the Stratos Datacenter. The special condition was that this user should expire automatically on 2023-12-07.

This ensures security and smooth access management, especially when developers or external people need access for a limited time.


Steps I Followed

  1. Logged in to App Server 1

First, I connected to the jump host and from there accessed App Server 1. and password : Ir0nM@n .

#ssh user@appserver1
ssh tony@stapp01.stratos.xfusioncorp.com

  1. Created User with Expiry Date

To create a user with expiry, Linux provides the -e flag in the useradd command.

sudo useradd -e 2023-12-07 anita

Here:

  • -e 2023-12-07 → Sets the expiry date.

  • anita → Username in lowercase as per standard protocol.


  1. Verified the User Expiry

I used the chage command to confirm if the expiry was set correctly:

sudo chage -l anita

Output showed:

Account expires : Dec 07, 2023

✅ Perfect!

Learnings from Day 2

  • Learned how to create Linux users with expiry dates.

  • Understood the importance of temporary access in real-world DevOps & system administration.

  • Practiced using useradd and chage commands.


🔮 What’s Next?

Tomorrow Day 3: Secure Root SSH Access

Stay tuned for the 100 Days of DevOps Challenge.

100 Days-KodeKloud

Part 1 of 2

"100 Days of DevOps" is a hands-on blog series where I document my daily progress, challenges, and learnings while completing real-world DevOps tasks through the KodeKloud Engineer Program.

Up next

100 Days of DevOps — Day 1: Linux User Setup with Non-Interactive Shell

Today I kicked off my 100 Days of DevOps challenge with the KodeKloud Engineer program. The journey started with a fundamental Linux administration ta