|
| Fixing Lost or Forgotten PassWord |
- There are at least 3 easy ways to Change the password
- These methods assumes you have write access to the root partition
- if you do NOT have write access, you can attempt to change it to rw permissions
- use the passwd command to change the passwd
- use "vi" to edit the passwd file
- unplug the machine from the network
- root# vi /etc/shadow
- reboot into single user mode to reassign a new passwd
- use "grep" to edit the passwd file (sometimes you dont have vi/emacs available)
- unplug the machine from the network
- root# echo "root:0:0:xxxx:root:/root:/bin/bash" > /etc/s.new
- root# grep -iv ^root /etc/shadow >> /etc/s.new
- root# mv /etc/shadow /etc/shadow.original
- root# mv /etc/s.new /etc/shadow
- reboot into single user mode to reassign a new passwd
- reconnect the network and boot as usual
|
| Your Root FileSystem ( / ) is okay --- you can get to the boot: prompt |
- Use the hard disk or a Boot Media ( floppy or cdrom ) to get to the boot: prompt
- Using Single User to fix root passwd
- normal way .. nothing else too seriously broken
- sometimes, you need to use a different root (/) partition
- System disk is broken, but lets see if bash works
- boot: init=/bin/bash
- root# mount -o rw,remount /dev/hda1 /
- root# mount -av
- root# change the passwd
|
| Things are bad, you cannot get boot: -- use a StandAlone boot media |
- When your system is dead, you need to boot something else
- Use a standalone boot floppy or cdrom to boot linux
( standalone boot works by itself and does NOT depend the hard disk )
- Clean up your "bad disk"
- e2fsck /dev/hda1
- if you have too many consecutive block errors ... your disk is too corrupted
- mount and edit your passwd file
- mount /dev/hda1 /mnt/test
- vi /mnt/test/etc/shadow
-- or --
- chroot /mnt/test ; passwd
- umount /mnt/test
- reboot
|
| Getting write permission to fix the passwd |
- If you did NOT have rw permission on /, there's probably something seriously wrong and
you should find out why not before you change it
- root# mount -o rw,remount /dev/hda1 /
|
| Resetting MS Windows Password |
|
|