Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Jan 12 '12 at 9:42

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

3  
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

1 Answer 1

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

root:!:13874:0:99999:7:::

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.

see

man shadow 
man 3 crypt 

for further details.

share|improve this answer

Your Answer

 
discard

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