Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

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.

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.