20 August, 2007

HowTo root login without password

Only add kernel parameter init=/bin/bash at boot time.

  • If the boot loader is GRUB, change string parameter from:
    kernel /boot/vmlinuz-2.6.15-26-386 ...
    to:
    kernel /boot/vmlinuz-2.6.15-26-386 ... init=/bin/bash

  • If the boot loader is LILO, enter:
    boot: linux init=/bin/sh



! You should have physical access to the linux server.
!! It works only when boot loader not have an own password.

Then you can do everything with root permissions, for example repair system or restore root password.
If you want to disable readonly mode, type mount -o remount,rw / in the command line.

No comments: