The fact that, In my Lab, one of the user who is in sodoers list has changed the root password, is there any way to reveal the password he has set? I know how to change it by editing from GRUB but what if I want to know what's the previous password.
It is a vast topic to discuss on. But considering the case of Ubuntu, the passwords are stored in the location
You can view the contents by opening it with
sudo nano /etc/shadow
On the very first line you can see
The first part is the username (Here it is root. You can see other users below). Then comes the hashed form of your root password. Usually once we assign a password to ubuntu, It generates a random salt value and add this salt value to the password file and then hashes it using any of the algorithms like sha512,md5,etc. Since the salt is unknown it is very hard for a cracker to crack the passwords. But you still can change your root password by simply typing the following on terminal
There isn't a way to decrypt the password. Historically, the encryption of Unix passwords has always been irreversible because the encryption is not unique to the password. There may be other passwords that will generate the same encryption string. Because of this, decryption to a single password is impossible. Unix takes the password that you enter at login, encrypts it, and compares the encryptions to see if you entered the correct password.