Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Change a lost root password using sudo' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change a lost root password using sudo
Authored by: mhrivnak on Sep 22, '06 03:57:18PM
Interesting info. Using 10.3, I was not able to use passwd while in single user mode. Likewise, all of the netinfo command line utilities would just hang. I ended up using sudo to change the root password. Note that this only works if a user account is setup to automatically log in, and is only necessary if you don't know the root password or a user password. Once in single user mode with the filesystem mounted and writeable...

# visudo

Add an entry like this:

someuser ALL=(ALL)NOPASSWD: ALL

Reboot, fire up a terminal, and...

$ sudo -s
# passwd

Now you've changed the root password, and you can do whatever you need. Remember to use visudo to remove that entry from /etc/sudoers, because it is dangerous!

[ Reply to This | # ]