User Passwd on Terminal - Sudo command

Hi,
I should like to know where and how can I find my super user password on the Terminal Ubuntu. Now, I can’t use the sudo command.
Thank’s a lot.
Jean.

Do you want the root password or your sudo password?
If you want the latter, it usually is the same as your user password.
If you become root through sudo like e.g. through issuing sudo -s, then you can change your root user’s password by issuing passwd.

1 Like

Default behaviour on a new Ubuntu install is there is no root password, you’re never asked to set it… if there is a “default” root password - I don’t know what it is - so it’s effectively “there is no root password” (and root login over SSH is blocked / disabled too).

I often don’t know the root password on my Ubuntu machines, if I ever need it - I just do what my esteemed colleague @Akito is suggesting :

Become super-ser :
sudo -i
Change root’s password :
passwd -r files root
note this should work just as well :
passwd root
as should this (while superuser) :
passwd
(but it may, or may not, ask you for the current password)

“passwd -r files root” is one of those “to be sure, to be sure”, i.e. to know we’re editing/modifying local passwd database and know we’re doing “root” account… I’ve seen cases where a careless “DBA” has logged in as “oracle” using a NIS account and changed the NIS Oracle user password (without telling anyone) - AND BROKEN EVERYTHING EVERYWHERE…

TL;DR :

sudo -i
passwd root

Yes. Could not exactly remember how Ubuntu handles it. I just know, that seemingly every derivative thas their own way. On Debian “Expert Install” you are asked, what you want to do about it. You can set a password, or not.
On Fedora, etc. you have to set it. I think BSD needs you to set one too, if I remember correctly (I actually remember only using a FreeBSD derivative that only has a root account by default, so I can’t even tell.).

Luckily, this only reflects what conventions and styles different distributions prefer. In the end, you can still modify the root password more or less the same way on every derivative (BSD being an exception in this list, as it is not Linux based).

Jean, if you are asking how you can find out what your root password is, I can tell you: it is not stored in some config file, there’s only a hash to confirm the correct entry. Once it’s lost, you have to reinstall your system.

However, as the other posters correctly pointed out: there’s no such thing on Ubuntu based systems. Your user password is the sudo password.

2 Likes