← Learn
Dangerous
mv ~/.ssh/authorized_keys /tmp/ak.bak && touch ~/.ssh/authorized_keys

linux · bash · Intermediate

Moves the existing list of authorised keys aside and replaces it with an empty file. Every legitimate key stops working immediately, the copy is left readable in a shared directory, and the empty file is now ready for someone else's key.

Signals to notice

  • Existing authorised keys removed
  • Copy left in a world-writable directory
  • Empty replacement file invites a new key

Think you can spot these under time pressure?

Start Training

More Credential Access