SharedMedia
16th November 2004, 10:12 PM
Security HowTO for a forgetful Admin.
WARNING: Mechanic is NOT Licensed, use Manual with CAUTION!
Ever FORGET the ROOT Password? Need to recover?.. :rolleyes:
Option 1:
1) Reboot (CTR-ALT-DEL) and at the lilo prompt type # linux single*
2) The kernel will load up and you will be straight into a root shell.
3) Now type passwd root to set the new password and reboot to resume operations.
* This assumes you have a kernel called 'linux' - you can hit tab at the lilo prompt to see the name of your Kernel.
Option 2:
You basically have to gain access to your machine somehow to alter the respective files. A pretty convenient way is to use the bootable installation CDs of some Linux distro and launch some "recovery console". If you can't see some comand like that you might try the ALT+F1..Fx keystroke to maybe get a clear console. Once you have managed to get into a shell you need to mount the partition that holds your /etc directory.
1) Open the file /etc/passwd and look for a line starting with ... root:x:.........
2) Delete the "x" in this line as it tells that the password is shadowed.
3) Save the file.
4) Open /etc/shadow and search for the entry for "root". Usually looks like this ... root:$s0m3fR1g9InMD5h45H:<numbers>:<more numbers>::::
5) Delete all values (the stuff between the columns) so that you get a line like this ... Root::::::::
6) Save the file, unmount the partitions and reboot. The root-account should not have set a password now, which you should change immediately again.
WARNING: Mechanic is NOT Licensed, use Manual with CAUTION!
Ever FORGET the ROOT Password? Need to recover?.. :rolleyes:
Option 1:
1) Reboot (CTR-ALT-DEL) and at the lilo prompt type # linux single*
2) The kernel will load up and you will be straight into a root shell.
3) Now type passwd root to set the new password and reboot to resume operations.
* This assumes you have a kernel called 'linux' - you can hit tab at the lilo prompt to see the name of your Kernel.
Option 2:
You basically have to gain access to your machine somehow to alter the respective files. A pretty convenient way is to use the bootable installation CDs of some Linux distro and launch some "recovery console". If you can't see some comand like that you might try the ALT+F1..Fx keystroke to maybe get a clear console. Once you have managed to get into a shell you need to mount the partition that holds your /etc directory.
1) Open the file /etc/passwd and look for a line starting with ... root:x:.........
2) Delete the "x" in this line as it tells that the password is shadowed.
3) Save the file.
4) Open /etc/shadow and search for the entry for "root". Usually looks like this ... root:$s0m3fR1g9InMD5h45H:<numbers>:<more numbers>::::
5) Delete all values (the stuff between the columns) so that you get a line like this ... Root::::::::
6) Save the file, unmount the partitions and reboot. The root-account should not have set a password now, which you should change immediately again.