Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I travelled from South America and I installed my old HDD and I forgot my Sudo Password. Please help me in retrieving it. Thank You.

share|improve this question
add comment

marked as duplicate by Jorge Castro, Luis Alvarado Mar 14 '13 at 19:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

Reboot into the recovery option (in grub). You may have to hold shift while booting to see grub. Then, at the shell run the command:

passwd yourusernamehere

Enter a new password and reboot.

share|improve this answer
add comment

Boot up using a Live CD like DSL or Slax. Then open etc/shadow of Ubuntu partition (which you've forgot it's root password) where you see something like below:

root:$1$aB7mx0Licb$CTbs2RQrfPHkz5Vna0.fnz8H68tB.:10852:0:99999:7:::

Just remove the string betwwen first : and second one i.e. you should have

root::10852:0:99999:7:::

Save the file and you'll be able to login to root without any password. And root can change your other user's passwords.

If you have already another host like Windows, you can use for example ext2fsd to open the file in Windows rather than a Live CD.

share|improve this answer
add comment

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