1

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.

ThomasReggi
  • 621
  • 2
  • 10
  • 25

2 Answers2

5

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!

Matthew Gall
  • 355
  • 1
  • 8
3
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.

J Baron
  • 338
  • 1
  • 7