Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to set new password of root in ubuntu 10.04 if I don't know root pasword and grub has no password . I want to know that whether I could get the old password which was set before I changed it. Does some file or command can give me access to old password of root

share|improve this question

migrated from Jan 12 '12 at 9:42

This question came from our site for professional and enthusiast programmers.

Only by cracking the password; the whole point of Unix password management is that if you don't provide the right password, you won't be able to get the password program to produce the right hash, and therefore you won't be able to get in. And the intention is that it is computationally infeasible to find the password given just the hashed (not encrypted) form of the password. – Jonathan Leffler Jan 12 '12 at 5:29

I'm not sure whether the password is saltet. If not, a rainbow table could help you crack it.

Normally, root should not have a password on Ubuntu at all, but you should use the sudo-mechanism to do sudo-tasks.

sudo grep root /etc/shadow

will show you, whether there is or not.

For me this reveals


which means, root has no password ("!" in second field, not a long hashcode).

A weak password might be cracked by brute force. A strong, salted password would be too expensive to crack and still last years.


man shadow 
man 3 crypt 

for further details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.