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.

Possible Duplicate:
How do I reset a lost Administrative(root) password?

I was having password issues, my authentication wouldn't work and i couldn't use sudo or log into root(I probably messed up the usage of the passwd command) Now I have reset the password via the shadow file for both root and my main account but my authentication isnt working and I'm hesitant to use passwd again. any advice for fixing this so I can authenticate privileges again?

Notes: I have log in without password enabled which I would like to disable but cant find a way I'm using ubuntu desktop 12.04 lts any other information needed just post here

share|improve this question

marked as duplicate by Jorge Castro, Uri Herrera, fossfreedom May 14 '12 at 10:36

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.

1 Answer 1

You say that you have reset the password via the shadow file. However, this file normally cannot be edited by hand.

The passwords in it are encrypted. If you simply delete the password in there, your account becomes passwordless, which means that you cannot log in with it to do most things (eg, sudo won't accept passwordless accounts).

To set a password for your account, you need passwd when logged in as that account, or sudo passwd <account> otherwise, which may be tricky if you can't use sudo - in which case you will need to go through the steps described here. Using passwd is much safer than attempting to edit /etc/shadow by hand.

share|improve this answer

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