Linux Labs

Users, permissions, and processes / Stage 8 of 13

Delegating commands with sudo

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 8 · lab · 20 mineasy

Suspend a user account

An employee is handing over their work. Block password and key logins to their account while keeping its data and running process.

Situation

An employee who worked under the labpaused account is handing over their duties. Until the handover is done, the account has to be suspended: no one may log in to it, either with the password or with an SSH key. Deleting it is premature — the home directory holds handover notes, and a background process of labpaused has been agreed to keep running until the handover ends.

Task

  1. The labpaused password is locked, and the password itself is neither deleted nor replaced: access must be restorable.
  2. The account has expired — its end date is in the past.
  3. The login shell is /usr/sbin/nologin, and the home directory in the record is unchanged.
  4. The key from /home/labpaused/.ssh/authorized_keys no longer works: there's no active key file, and an exact copy of it sits in /srv/account-review/authorized_keys.saved, readable by root only (owner root:root, mode 600).
  5. The home directory, .ssh and notes.txt are in place with their original owner and mode, and notes.txt is unchanged; other accounts, sudo and SSH settings are untouched.
  6. The background process of labpaused keeps running — the same one that was started.

Constraints

  • Don't delete the account and don't kill labpaused's processes.
  • Account changes need sudo.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 6
  • labpaused's password is locked and the original one is kept — not done yet
  • The account has expired — its end date is in the past — not done yet
  • The login shell is /usr/sbin/nologin and the home directory is unchanged — not done yet
  • The key from authorized_keys no longer works and its copy is readable by root only — not done yet
  • The home directory, .ssh and notes.txt are kept; other accounts and settings are untouched — not done yet
  • The original background process of labpaused keeps running — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 6
  • labpaused's password is locked and the original one is kept — not done yet
  • The account has expired — its end date is in the past — not done yet
  • The login shell is /usr/sbin/nologin and the home directory is unchanged — not done yet
  • The key from authorized_keys no longer works and its copy is readable by root only — not done yet
  • The home directory, .ssh and notes.txt are kept; other accounts and settings are untouched — not done yet
  • The original background process of labpaused keeps running — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 6
  • labpaused's password is locked and the original one is kept — not done yet
  • The account has expired — its end date is in the past — not done yet
  • The login shell is /usr/sbin/nologin and the home directory is unchanged — not done yet
  • The key from authorized_keys no longer works and its copy is readable by root only — not done yet
  • The home directory, .ssh and notes.txt are kept; other accounts and settings are untouched — not done yet
  • The original background process of labpaused keeps running — not done yet
Loading…