DEV Community

Cover image for 5.Temporary User Setup with Expiry
Thu Kha Kyawe
Thu Kha Kyawe

Posted on

5.Temporary User Setup with Expiry

Lab Information

As part of the temporary assignment to the Nautilus project, a developer named jim requires access for a limited duration. To ensure smooth access management, a temporary user account with an expiry date is needed. Here's what you need to do:

Create a user named jim on App Server 1 in Stratos Datacenter. Set the expiry date to 2026-12-07, ensuring the user is created in lowercase as per standard protocol.

Lab Solutions

🧭 Part 1: Lab Step-by-Step Guidelines (Technical Execution)

🔹 Step 1: Log in to Jump Host
ssh thor@jump_host.stratos.xfusioncorp.com

Password:

mjolnir123

🔹 Step 2: SSH into App Server 1
ssh tony@stapp01.stratos.xfusioncorp.com

Password:

Ir0nM@n

🔹 Step 3: Switch to Root

sudo -i
Enter fullscreen mode Exit fullscreen mode

🔹 Step 4: Create user jim with expiry date

useradd -e 2026-12-07 jim
Enter fullscreen mode Exit fullscreen mode

⚠️ Username must be lowercase as specified: jim

🔹 Step 5: Verify user creation

id jim
Enter fullscreen mode Exit fullscreen mode

🔹 Step 6: Verify expiry date

chage -l jim
Enter fullscreen mode Exit fullscreen mode

Expected output should show:

Account expires : Dec 07, 2026

✅ Final Checklist

✔ User jim created
✔ Created on App Server 1 only
✔ Username in lowercase
✔ Expiry date set to 2026-12-07
✔ Expiry verified with chage -l

🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)
🔹 Why set an expiry date?

Temporary project members should not:

Retain access after their assignment

Require manual removal later

Account expiry automates access control.

🔹 What does -e do?

-e stands for expire date.

Format required:

YYYY-MM-DD

So:

-e 2026-12-07

means the account will automatically lock after that date.

🔹 Why verify with chage -l?

chage -l jim displays:

Account expiry

Password aging information

This confirms the lab requirement is met precisely.

🔐 Security Context

Temporary accounts:

Reduce long-term access risk

Prevent forgotten active accounts

Improve compliance and audit readiness


Resources & Next Steps
📦 Full Code Repository: KodeKloud Learning Labs
📖 More Deep Dives: Whispering Cloud Insights - Read other technical articles
💬 Join Discussion: DEV Community - Share your thoughts and questions
💼 Let's Connect: LinkedIn - I'd love to connect with you

Credits
• All labs are from: KodeKloud
• I sincerely appreciate your provision of these valuable resources.

Top comments (0)