Sudo commands are usually logged. If you may have changed the root password by mistake, and you used sudo (not su first), check /var/log/messages log file.
The date & time and user should be listed. For example:
Code:
Dec 3 21:22:48 elite sudo: jschiwal : TTY=pts/2 ; PWD=/home/jschiwal ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/messages
To change the passwd back:
Another option, if you don't have a live distro CD, is to add "init=/bin/sh" to the kernel boot arguments. You will need to mount your root filesystem. One thing I have done, is to copy my regular users /etc/shadow entry to root, reboot, and then run "passwd" as root normally. Another is to chroot to your regular root partition, and run "passwd" as normal.