Super User is a question and answer site for computer enthusiasts and power users. 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 recently accidentally forgot my user password to my shell. I know the root password. How do I change the user password?

I figure it's something like

$su root
$passwd -[something] username

but I can't get it to work. Halp pls?

share|improve this question
up vote 3 down vote accepted

just "passwd mechko" I think, if you're logged as root ? tried it ? as existing password use roots or mechko's (in this case roots)

share|improve this answer
    
Thanks a lot. I was looking at man pages even before I tried changing it so I got confused :-p – mechko Jan 10 '10 at 1:48
    
passwd $user as root doesn't require providing the current password. – Blacklight Shining Oct 7 '13 at 12:49

Old school, more powerful than necessary method:as root empty the password field for that user in /etc/passwd or /etc/shadow. Then you can login and change the password.

share|improve this answer
    
I'll keep that in mind for next time :D – mechko Jan 10 '10 at 1:49
2  
no, don't, unless you know how to fix it when you break things. the passwd command exists for a reason. – user23307 Mar 1 '10 at 2:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .