I'm just curious because I know the configuration for the password is located in /etc/passwd, but in the document I don't see my actual password anywhere, obviously for security reasons. I opened passwd- with less in the terminal and it can't be found there either.

How does Ubuntu know and read the password you give it?

2 Answers 2


The password is not in /etc/password file in Unix systems ... some decades ago :)

The same policy is applied in Linux (Ubuntu too). Your passwords are encrypted in /etc/shadow file, and you need to be root to read the file. The passwords in /etc/shadow are hashed and this is an one-way operation. Ok, you will need (1) the string used for hash operation and (2) the hash algorithm used, and you can will try decrypt the /etc/shadow file (and remember, you will need root permissions for read this file).

You can find more details in this answer:

How to decode the hash password in ./etc/shadow


Passwords are stored in /etc/shadow. They are encrypted. Integrity of /etc/passwd and /etc/shadow can be verified via pwck command:

pwck -r /etc/passwd
pwck -r /etc/shadow

Passwords were once storred in /etc/passwd, but then they were moved to /etc/shadow to restrict access – while /etc/passwd can be read by any user, /etc/shadow is accessible only by root by default.

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.