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.

  • If there was an easy way for you to know the password, there would have been an easy way for wrongdoers to know the password too. That defeats the purpose of a password.
    – Alaa Ali
    Sep 15, 2014 at 3:21
  • This question appears to be off-topic because it is about bypassing security. There is no actual ubuntu problem. Sep 15, 2014 at 6:09
  • @LuisAlvarado This certainly applies to Ubuntu. It seems to me this is about Ubuntu. Presumably the system on which this password has been set is an Ubuntu system. If this weren't about "bypassing security," would you have felt comfortable closing it with a single moderator close vote? (It had no other close votes before that.) As far as I know we have no community consensus that questions about "bypassing security" are off-topic. Sep 15, 2014 at 10:33
  • There is no indication that this is about Ubuntu anywhere on the question. Furthermore this is more related to bypassing an actual security feature than solving an ubuntu problem. Sep 15, 2014 at 16:00
  • @LuisAlvarado , mate if this wouldn't be a question from Ubuntu, I wouldn't post in here. as far as I know, Grub, Sudoers, root are the concepts from linux alone, I don't think Windows OS has these concepts! so don't use your Reputation and powers over my question and put it on hold.
    – T3J45
    Sep 18, 2014 at 9:26

2 Answers 2


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

sudo passwd
  • 1
    Thank you. I made a pretty good search, but it's the first time i've heard the concept of Salt value and sha512. I'll expand my search over this. Thanks again.
    – T3J45
    Sep 15, 2014 at 16:22

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.