Server Fault is a question and answer site for system and network administrators. 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'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
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
sudo passwd <username>

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


You can also always su up/down by typing:

su <username>

And then using the passwd command.

share|improve this answer

Your Answer


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.