Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

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

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