Novice support for usermod calamity

I have been using Manjaro for more than 1 year pretty much straight out of the box. I am quite illiterate when using a terminal but decided to follow a youtube guide to installing nordvpn. All was going well until I attempted to perform “nordvpn login”. My terminal came up with an error and in red advised me to “usermod -aG $USER” (I’m pretty sure that it was -aG but my memory is lousy). On restarting my computer I cannot get super user status and my old password is no longer recognised.
Can someone help me using relatively non technical language please? Thanks.

This here is what you should have perused - hopefully the information in the video that you followed was the same, but I doubt it.

NordVPN - ArchWiki

usermod -aG $USER

means that you should add your user account to be part of a certain group - a group that allows you to use the VPN, I suppose

Use the Arch wiki, instead of some video.
Always!


PS:

If you omitted the -a (and just used the -G) then the consequences could be dire and lead to what you say:

type:
history
into your terminal, to see what commands where last executed - hopefully it helps to refresh your memory

… but any slip up like that is rather easily fixable
will require some effort outside your comfort zone, though

It seems like you (we) first need to fix your super powers :wink:
your ability to gain root permissions …

1 Like

Hi and thanks for your reply. I typed in “history” and, you are absolutely correct I had omitted the -a and entered “sudo usermod -G nordvpn $USER”

https://wiki.archlinux.org/title/Usermod

so:
can you still gain root (admin) access?

su -

does that give you root access?

sudo su

will probably not work - or does it?

whoami

will tell you

Yes, I get “xxxx is not in the sudoers file.”

be specific, please

which of the two commands gives you which response?

Apologies.

su - produces a request for password and when that is entered I get “[lenovo ~]#” in red highlight.

sudo su produces a request for password and when it is entered I get “xxxx is not in the sudoers file.”

whoami produces my name “xxxx”

Hopefully this makes it clearer for you

then you can use that command
the # (and the red colour) indicates that you are root after that

type:
whoami
and see the response, which should confirm that

I have followed your instructions. When I enter whoami I get “root”

ok
from there
what does the command:
groups $your_username
return?
obviously, replace $your_username with your actual user name

It should return something like:
wheel lp sys network power …and your user name …

the group name “wheel” is especially important here and needs to be there

Thanks very much for your continuing help. The commend groups $my_usename returns the response “root”

I sincerely hope you are aware that

is a placeholder
you need to replace it with your actual user name


if

returns:
root

then that is … quite strange and unusual

OK, sorry. I enter the command “groups” followed by my username (dave) and I get the response: “nordvpn dave”

ok - that is also useful information

…standby a bit till I compile a useful/actionable response


which is:
gpasswd -a dave wheel lp sys network power

you might have to do it one at a time
I’m not sure - could be.

wheel
is the most important - it’ll give you sudo access back

gpasswd -a dave wheel
gpasswd -a dave lp
gpasswd -a dave sys
gpasswd -a dave network
gpasswd -a dave power

After that:
open a new terminal (keep the other one open, just in case)
and type:
sudo su -

and you should be able to log in as admin

1 Like

Hi and thanks. I had to enter the commands one at a time. I opened another terminal and entered “sudo su -” and got the response “dave is not in the sudoers file.”

what does
groups dave
return now?

it returns “wheel lp sys network power nordvpn dave”

please post the result of:
cat /etc/sudoers.d/10-installer

it should return:
%wheel ALL=(ALL) ALL

… the chosen user account should be member of the group “wheel” - to be able to gain admin rights …

1 Like

Yes, I get “%wheel ALL=(ALL) ALL”