Interview Prep/Linux/Security, hardening and incident response

You need to give a vendor temporary root-level access to debug an appliance VM for one day. How do you control it?

AdvancedScenarioSecurity, hardening and incident response
Answer

Situation read → Time-boxed, recorded, revocable access.

What I'd do →

  1. Create a user with an expiry: useradd -e 2026-11-10 vendor1.
  2. Grant sudo only via a dated drop-in and remove it with an at job: echo "rm /etc/sudoers.d/vendor1; usermod -L vendor1" | at 18:00 tomorrow.
  3. Enable session recording (tlog, sudo log_output, or bastion recording).
  4. Allow their source IP only on the firewall.
  5. Review recordings afterwards and rotate any secrets they could see.

Why → Access that removes itself can't be forgotten.

Interview tip → Better: SSH certificates with an 8-hour validity, issued just for them.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response