My user is suddenly "not in the sudoers file"!?

I installed Silverblue a few weeks ago but only really used it during weekends to troubleshoot what didn’t work.

Yesterday, this popped up:

Now, I’m not 100% certain that Silverblue didn’t force me to enter a different password for admin compared to my one and only regular user, so I tried all combinations of how I usually construct my passwords and it didn’t work (really hoping Silverblue doesn’t have some silly rule like this).

So that’s certainly a new huge issue, but also:

One of the things I’ve been trying to troubleshoot is me not getting remote desktop to work, but I finally found a solution that worked for all of almost 24 hours:hot_face:

I wondered if these two things may be related, so when I tried to cut and paste the above solution into a terminal again, I was greeted with this message:

“eobet is not in the sudoers file”

I’m sorry, but at this point I can only say:

W T F

(Now, I just have to say that I’m currently doing internet searches for this error message and I got a surprising amount of hits, so it seems to not exclusively be a Silverblue issue, but probably an issue enough to drive a number of people, soon possibly including me, back to Windows…)

Oh noooooooo, reading this page is the reason why I suddenly lost my only user’s privileges, because I was trying to get file sharing with Windows going and apparently moved my user to a different group since I was following these instructions???

I always suggest doing testing with an extra username and not your user with admin rights.

2 Likes

Edit … again … sorry about that …

  1. While the system is booting, interrupt the boot sequence at the GRUB2 menu by using the Esc key.
  2. Select the boot entry that you wish to edit using the arrow keys.
  3. Edit the selected entry with the e key.
  4. Use the arrow keys to select the line beginning with linux, linux16, or linuxefi.
  5. Go to the end of that line and append init=/bin/bash to the end of the line.
  6. Press Ctrl-x or F10 to boot the entry.
  7. At the resulting bash prompt, run the following commands:
# mount -t selinuxfs selinuxfs /sys/fs/selinux
# /sbin/load_policy
# /sbin/usermod -aG wheel yourusername
# sync
# /sbin/reboot -ff
3 Likes

Have you tried booting an older deployment (select it from grub)? Every deployment keeps its own version of /etc so the previous one might work, should be worth trying.

1 Like

I got cached with the same issues, when I tried a long while ago the same. Useradd -G has missing logic, to tell you when you try to add an existing user, alias you would have to list the existing groups you already have been member of.

man useradd:

   -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
       A list of supplementary groups which the user is also a member of. Each group is separated
       from the next by a comma, with no intervening whitespace. The groups are subject to the same
       restrictions as the group given with the -g option. The default is for the user to belong
       only to the initial group. In addition to passing in the -G flag, you can add the option
       GROUPS to the file /etc/default/useradd which in turn will add all users to those
       supplementary groups.

Just to point out the mistake and a solution for further users.
As it is:

This example creates a system group myfamily for two new users jack and maria.

sudo groupadd myfamily
sudo useradd  -G myfamily jack
sudo useradd  -G myfamily maria

As it should be, without being moved into a only group, an additional command:

This example creates a system group myfamily for two new users jack and maria.

sudo groupadd myfamily
gpasswd -a $USER myfamily      # add the logged-in user to the myfamily group !
sudo useradd  -G myfamily jack   # add the new users to the myfamily group.
sudo useradd  -G myfamily maria

Solution found at:

1 Like

This not works, you have to been in other groups to get hit with this problem.

Thank you very much for this guide! :pray:

I got this far using it:

In the troubleshooting link you posted I see a section named “Unable to add user to group” which maybe fits where I am now, but I must confess I have a difficult time understanding that paragraph…

that should be /sbin/usermod -aG wheel eobet

sorry about that (fixed)

1 Like

Thank you again so much! :hugs:

I should possibly have understood what’s missing because when I tried OpenSuse Aeon it also required /sbin/ in front of everything, but I’m in such deep waters here that I didn’t dare to risk typing anything wrong.

1 Like

This seems the result of a $PATH that is not the normal path for users.

You can see what the path actually is for that user with echo $PATH

1 Like