| Task | Description | Command | Verification |
|---|---|---|---|
| Connect to Target Server | Access App Server 2 | ssh steve@stapp02 |
Successful login to App Server 2 |
| Verify File Exists | Ensure the script is present in /tmp |
ls -l /tmp/xfusioncorp.sh |
Confirms ownership and permission details |
| Grant Execute Permission | Make /tmp/xfusioncorp.sh executable by all users |
chmod 755 /tmp/xfusioncorp.sh |
ls -l /tmp/xfusioncorp.sh should show -rwxr-xr-x |
| Command | Purpose | Expected Result |
|---|---|---|
useradd -e 2024-03-28 james |
Create user with expiry | User created successfully |
passwd james |
Set password | Password set |
chage -l james |
Check expiry | Expiry shows Mar 28, 2024 |
| Step | Description | Command |
|---|---|---|
| 1 | SSH into App Server 2 | ssh steve@stapp02 |
| 2 | Verify user doesn’t exist | grep mariyam /etc/passwd |
| 3 | Create user with non-interactive shell | sudo useradd -s /sbin/nologin mariyam |
| 4 | Confirm configuration | grep mariyam /etc/passwd |
| 5 | Test shell restriction | su - mariyam |