How
to change the root password if you've forgotten it?
First of all you have to pass the linux kernel a boot-time parameter, ie before booting you have to tell Linux not to do the regular stuff but something special. Now, if you've got LILO installed press Ctrl-X to get to the text mode. Then press tab and see by what name does LILO refer to you Linx kernel image. Mine refers it to as "mykernel" yours most probably would be called "linux". So you type this: boot: linux init=/bin/shInstead of the regular rigmarole, liux will now boot with just the shell. It will give you a bare system with you root filesystem mounted in read-only mode. So now, before you do something else you go ahead and mount the filesystem as read-write. # mount -o remount,rw / # mount /procI am not sure whether you really need to mount the proc filesystem. Now to actually change the password: # passwdBut the job aint over - dont aim for that reset button yet..... now you gotta get your filesystems back in read-only state, so that you can shut-down the system without any data loss. # umount /proc # mount -o remount,ro /Note: the command is umount and not unmount
Frequently Used Options
Have a Linux Issue?
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|