Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm logged into (ssh) my ubuntu server into a non-root user account. I can not directly ssh into the server as root, because I disabled it. I have the root password. I need to change the user password that I am currently logged into without its password, from within this user.

I forgot the command but there was a way to act as foot from within this account, from in there can I change this password?

I'm a little lost, so any help could help.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Pretty simple, assuming you know the password for root:

su root
passwd {username}

Replace "{username}" with the username you wish to change the password for. You will be prompted for your root password, and you shouldn't be prompted for the old user password for the user you are making modifications for!

share|improve this answer
    
Amazing, exactly what I wanted!!!!!! –  ThomasReggi Jun 21 '12 at 15:33
    
No worries! Glad I could help ;) –  Matthew Gall Jun 21 '12 at 15:33
add comment
sudo passwd <username>

if you don't have access you can edit the sudo rules by running:

visudo

You can also always su up/down by typing:

su <username>

And then using the passwd command.

share|improve this answer
add comment

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.