Hacking password protected “single user” mode in Linux

Single user mode can be protected by appending this line in /etc/inittab

su:S:wait:/sbin/nologin

if this line is present in the /etc/inittab – the machine will ask for root p@$$word

Hack

while booting p@$$ this kernel parameter –

init=/bin/bash

by p@$$ing this parameter, I am saying to the kernel, “rather than starting /sbin/init and proceed with the usual /etc/rc.d/* procedure, just simply give us a shell”. That means:

NO p@$$word checks
NO filesystem checks
NO startup environment

…as no filesystem checks has been made, the filesystem will be in read-only mode.

Now give this command, to make root filesystem writable.

mount -o remount, rw /

Once the p@$$word is reset or done anyother thing you wanted to do, DO NOT REBOOT.

mount -o remount, ro /

NOW PRESS THE RESET BUTTON

You can also see the video of this post

God Bless

Alok Srivastava

Advertisements