Lab 005: Linux User Expiry
Requirements
A developer named rose has been assigned Nautilus project temporarily as a backup resource. As a temporary resource for this project, we need a temporary user for rose. It’s a good idea to create a user with an expiration date so that the user won't be able to access servers beyond that point.
Therefore, create a user named rose on the App Server 1 in Stratos Datacenter. Set expiry date to 2021-01-28. Make sure the user is created as per standard and is in lowercase.
Note
This lab demonstrates setting account expiry dates for temporary user accounts.
Prerequisites
- SSH access to App Server 1 with root or sudo privileges.
- User management tools available (useradd, chage).
Steps
Login to the app server and switch to root. For the server credentials, check out the Project Nautilus documentation.
sshpass -p '*******' ssh -o StrictHostKeyChecking=no tony@172.16.238.10
sudo su -
*******
[root@stapp01 ~]# useradd -e 2021-01-28 rose
[root@stapp01 ~]# chage -l rose
Last password change : Jul 26, 2023
Password expires : never
Password inactive : never
Account expires : Jan 28, 2021
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
Verification
- Confirm user
roseexists withid rose. - Confirm expiry date is set with
chage -l rose. - Confirm account expiry date shows Jan 28, 2021.