Well, if it's redhat 6.2, (from 2000) this is what one can do: since lilo boots directly into Linux (unless there is a prompt or delay config in /etc/lilo.conf), hold down the Shift key whilst starting up the machine. This will force the display of the "boot:" prompt at which you can insert "linux init=/bin/sh rw" without the quotes. Replace "linux' with the label of the current kernel if it's not called linux. Hit enter and it should boot to a shell. If you delete all of root's passwords in /etc/passwd /etc/passwd- /etc/shadow /etc/shadow- as the edit, and then run "mount -o remount,ro /", "sync" and "/sbin/reboot -f", you can do "su -" when the machine comes up again and root should appear without need for a password after which you can run passwd to get a new password. If you don't know the label of the current kernel, then you can use a rescue disk to boot up in ram, mount the / partition and and read the /etc/lilo.conf file to get it. And, the password is in the second field in the passwd files. In the shadow files, it's long. In all cases, delete all characters and numbers and leave nothing in that field, then save the files.
Last edited by tomwest; 09-27-2015 at 01:52 AM.
|