Interview Prep/Linux/Security, hardening and incident response

A user reports their account was used to log in from another country. How do you investigate?

IntermediateScenarioSecurity, hardening and incident response
Answer

Situation read → Possible credential or key theft.

What I'd do →

  1. Lock the account and kill sessions: usermod -L user; pkill -u user.
  2. Check logins: last -F -i user, journalctl _COMM=sshd | grep user for IP and key fingerprint.
  3. Review .bash_history, authorized_keys (new keys?), crontab and files they touched.
  4. Rotate their keys/passwords and check other systems they access.
  5. Add MFA or geo/IP restrictions.

Why → The fingerprint tells you which key was used, which narrows down where it leaked.

Interview tip → LogLevel VERBOSE in sshd is what makes fingerprints appear in logs.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response