Finding Out The Root Password

Hi everyone I’m new to linux and recently installed manjaro kde on a laptop. I’m not entirely sure if this is the right support subforum to ask this question but I didn’t notice a more specific one. I’ve ran basic updates in pacman but when I try using sudo commands it always asks for a password which I get incorrect and don’t know. I set the login and admin passwords the same when I installed manjaro. To get around this I use the su command before using sudo and then the password I set at installation will work however when I watch tutorials online I don’t notice people having to input su in the terminal first. I’m somewhat confused over what is the standard password and which is the root password. Is the root password the password I set at installation and works with su or is it preset at installation and I didn’t notice to write it down? If I don’t have the root password is there an easy way for me to access it? I did watch a tutorial where it was reset in grub but I’m still pretty new to all this so would like to avoid having to do that for now if I don’t need to.

Hi,

If I understood correctly you first run su and then use sudo to run commands.
You don’t need to do this.
su actually means “let me become the root user”, and once you are root your prompt goes from “$” to “#”.
According to some people, su is useful for 2 things :

  1. Make a huge mistake
  2. Fix that huge mistake

In other words, don’t use su, you only need sudo, which means “run the following command as root user”, so just do this : sudo pacman -Syu, you’ll be asked to enter your password and then the command shall run fine.

Thanks. So if I enter su first in the terminal is the password I enter after that with su the root password which I set at installation? The problem I have is that if I don’t enter su first and try sudo commands it asks me for a password I don’t know and always get wrong after 3 attemps.

Is your user account a member of the “wheel” group?

groups

will tell you the groups your account belongs to - “wheel” should be among them, listed in the output of that command

So if I enter su first in the terminal is the password I enter after that with su the root password which I set at installation?

Yes. But don’t use su.

The problem I have is that if I don’t enter su first and try sudo commands it asks me for a password I don’t know and always get wrong after 3 attemps.

It should be the exact same one

Point of information - sudo actually means ‘run as another user’ … it just defaults to root.

1 Like

I’m not on my linux system at the moment I’ll try and find out in a bit.

Okay, I’m not exactly sure what’s going on but it seems to be working on. I ran a standard sudo pacman -Syu command and entered my password and it didn’t throw password incorrect this time so it looks like it’s working. I’d just like to confirm is the admin password we set as installation the same as the root?

It is, In a single user system you can see root and admin as the same thing.

What happened is that you “became” root for running this command only, If you try to run it without sudo, you will get an error because this operation requires eroot privileges for security reasons. On the other hand, su makes you become the root user until you run exit, but as I wrote earlier, don’t use it, unless you know what you are doing

For ‘su’ you need root’s password, for ‘sudo’ you need your password. There is plenty of articles if you take a minute and google it.

try:
su root
if your users password succeeds
it is the same
if it doesn’t
its either not set at all (no extra password set for user root or none at all)
or it is not the same

What about the return of the
groups
command?

his sudo pacman -Syu seemed to run fine so he should be in the wheel group

… yes, he should be …
it’s a bit messy … not clear from what is being said

… I have a keyboard where the “i” key sometimes does not work right
perhaps it’s that kind of issue …
since passwords are never shown or typing them does not get any feedback … :wink:

… it’s hard for me to replicate because I switched to doas instead of sudo
so, for me, sudo is really non existent - just as a symlink to sudo …

Wheel group. Everything seems to be working fine I think now thanks :grinning:

hmm -
… working fine where it wasn’t before …
… working fine without having changed anything …

That’s because he did this

su # becoming root
sudo pacman -Syu # running as root while being root ==> messed up

… nah
don’t know where this is from
pacman, to install anything
must be ran as “root”
an additional sudo, after already being root
cannot “mess” with anything even more

something else was going on … perhaps even just a mistyped password …
who knows …

Sounds a lot like a ‘false’ system … whether its hybredized, broken beyond belief, or actually someone failing to install or arch … etc.
The first/main/only user not being part of ‘wheel’ … is certainly something aside from or despite manjaro.