User Tools

Site Tools


obtain_root_shell_after_booting

Obtain_root_shell_after_booting

Most people use a LiveCD or use single-user-mode. Another way is to edit grub and pass a init=/bin/bash option at the end of the kernel config line.

1. At the Grub Menu (for debian, blue square with text entries), select the boot line and press “e” to edit. 2. Go to the kernel line and press “e”. 3. At the end of the kernel line (after root=/dev/sda1) put: init=/bin/bash (then press enter) 4. (back at the grub menu) Press “b” to boot. 5. You will be dropped into a root shell with /dev/sda1 mounted readonly. ( root@(none):/# ) 6. To mount the filesystem rw, type: mount -o remount,rw / 7. Check with df -h. Type “passwd” to change root password if need be.

obtain_root_shell_after_booting.txt · Last modified: 2022/07/19 21:13 by 127.0.0.1