Check out my first novel, midnight's simulacra!

Physical access

From dankwiki
Revision as of 08:59, 29 May 2020 by Dank (talk | contribs) (Created page with "So you've got physical access to a UNIX box. How do you get root access? ==Removing root password== This requires that the filesystem containing <tt>/etc</tt> is not encrypte...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

So you've got physical access to a UNIX box. How do you get root access?

Removing root password

This requires that the filesystem containing /etc is not encrypted. Remove the disk with the filesystem containing /etc, and mount it on another machine.

  • Edit /etc/passwd, and remove the second field for the root entry:

root::0:0:root:/root:/bin/bash

  • Edit /etc/shadow, and do the same:

root::18242:0:99999:7:::

  • If you intend to set a new root password using passwd, it's recommended to add an 'x' back to the /etc/passwd, so that /etc/shadow is used again:

root:x:0:0:root:/root:/bin/bash