0

I am trying to use sudo on a linux server but have forgotten my password. is there any way to retrieve it?

Is this the same password I use to login to ssh?

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
Bella
  • 1

1 Answers1

0

sudo is a utility to execute a command as another user. So if you have superuser-privileges, then you (your current user) can run a command as e.g. the root-user. Therefore you only need to use the password you also use for login.

But it might be that you do not have superuser-privileges. This is defined in the root-only readable file /etc/sudoers. There you find a line similar to

%sudo   ALL=(ALL:ALL) ALL

(although another group name could be used instead of sudo, e.g. wheel, depending on your distribution). Any user part of this group is able to run the sudo-command.

If you cannot run sudo, you are probably not part of this group (or you just became part of the group and need to logout and then login again).

n0542344
  • 386