This is a PIA, but, there is a way to recover a system without a password (digging through old notes--I've done this, I know I have it somewhere)--oh, here it is:
1. reboot and type: linux init=/bin/sh rw 2. at the Lilo boot prompt (if you are using Grub hit the 'e' key twice and add init=/bin/sh rw to the boot command and then <enter> and 'b' to boot This will boot into the non-protected minimal root shell. 3. Once the sysem is up, type vi /etc/passwd Have a look at this file. It can't contain any blank lines, comments or non_ASCII characters. If you find any, delete them (x). The entry for 'root' must look exactly like this: root:x:0:0:root:/root:/bin/bash If it's not, change it with the insert command (i) and save the file (ESC and then :wq!). 4. Check permissions with ls -l /etc/passwd They should be -rw-r--r--. 5. Run #vi /etc/shadow The format of entries in '/etc/shadow' is [accountname]:[password]:[other stuff] etc root:$1$KODLG[etc]:10979:0:99999:7::: The password entry is encrypted. Delete it by moving the cursor to the first character of the password (usually the first '$') and typing dw Now type wq! to save the file. 6. Look at /etc/securetty which should contain entries for tty1 through tty6 7. Ownership of /root/.bash_profile, /root/.bashrc, and /etc/gettydefs must be 'root' and must be read/writable by root. 8. Type the command sync && mount -o remount,ro / This writes the buffer content to disk and remounts the partition read-only. 9. Press CTRL-ALT-DEL to reboot 10. At login, type 'root' for the account name and hit ENTER at the 'password' prompt. Type passwd to give "root' a password You should be able to troubleshoot your problems as 'root', now. On Monday 23 June 2003 08:26 pm, Wade Waldron wrote: > Tried to run passwd from rescue. The file is listed in /etc. It does not > have * beside it, implying that it is not runnable. When I type the name, > it does not work because it is not runnable. So now what? > > Wade >
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
