Tuesday, April 03, 2007

Lost root password

For a colleague I had to install Oracle Infrastructure on Suse Linux. The installation went very smoothly, but at the end I was facing a big problem. As you know, at the end of any Oracle installation you are asked to run a script called root.sh as root. So, you must have access to the root password for that host. Normally that is not a problem, but this time I did not know the password. When asking other colleague's, I found out that the password was once changed, and it seems nobody knew what the new password was. So, who to reset or change the root password when you don't know the old one ?
Another colleague of mine showed me some Google results, and we tried to change a unknown root password. This is what we did..

- We restarted the operating system (Suse..) and interrupted the start up so we could use a command line
- we typed in : init=/bin/bash and resumed startup
- on the following command prompt : mount -o remount,rw /
- at this point you can enter passwd and change the root password without knowing the old one !

1 comment:

Anonymous said...

I seem to remember in redhat you could boot into single user mode and change the password from there - its been a while not sure if thst can still be done, though.