Not in sudoers file after installing docker
Hey everyone, I got this message, "maxwell is not in the sudoers file. This incident has been reported to the administrator." while trying to run some sudo commands after recently following the instructions to install Docker here: https://en.opensuse.org/Docker I was following the Yast2 installation instructions until I got to the adding user to the docker group step. For some reason I thought I would continue the steps using the command line so I ran following commands which I got from the "history" command: 861 sudo usermod -G docker -a $USER 862 sudo systemctl restart docker 863 docker version 864 docker run --rm hello-world 865 echo $USER 866 man usermod 867 systemctl start docker -- 868 docker run --rm hello-world 869 sudo zypper dup 870 sudo shutdown -r now After those last two commands I was starting to get worried, but I can still login as root (su) and use Yast to do stuff. I figured it might be an issue with how I ran the usermod command, but I'm not sure. On the bright side Docker is installed now. Things I have tried: restart my computer use Yast to add my user account to the wheel group use Yast to remove myself from the wheel group use Yast to add myself to the user group restart after doing those group changes I am running Tumbleweed.
Update: I tried creating a new user just to see what groups get added and it looks like it's just the 'users' group. The current groups for my account are 'users', 'docker', and 'maxwell'.
Il 04/11/22 20:22, Maxwell Heeschen ha scritto:
Update:
I tried creating a new user just to see what groups get added and it looks like it's just the 'users' group. The current groups for my account are 'users', 'docker', and 'maxwell'. I used the suggestion posted on factory:
For now there is a way to go back without reverting: # visudo -f /etc/sudoers.d/user Defaults targetpw # Ask for the password of the target user ALL ALL=(ALL:ALL) ALL # WARNING: only use this together with 'Defaults targetpw' Regards, -- Marco Calistri Build: openSUSE Tumbleweed 20221103 Kernel: 6.0.6-1-default - XFCE: (4.16.0)
Oh thanks that worked! So I think I found the same thread you did. Am I correct in thinking that I lost sudo-ability because I updated? -Maxwell
On Fri, 4 Nov 2022 20:42:42 -0300, Marco Calistri <PY1ZRJ@outlook.com> wrote:
I used the suggestion posted on factory:
# visudo -f /etc/sudoers.d/user
Defaults targetpw # Ask for the password of the target user ALL ALL=(ALL:ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
Those two lines suggested as the contents of /etc/sudoers.d/user , were in the old default, unedited /etc/sudoers before the recent update of Tumbleweed, which removed them if sudoers had not been modified. They serve, as the comment says, to allow you to use sudo while providing the root (or whatever user) password. It is my understanding that that is not a preferred setup for sudo, and the rationale for it was so that on a new install, sudo could be used before it was properly configured for the admin user(s). In cases where it is undesirable to specially configure sudo, I guess the suggestion is a good solution. But, if you configure sudo for the admin user, they can use their own password, and those two lines are not needed, and in fact they might have to be removed in that case (I don't know. Read the docs.) For my own configuration, I have always commented out those two lines in /etc/sudoers and un-commented the line allowing wheel group members to execute commands (separately adding myself to the wheel group, of course). In the past, I needed to enable keeping my Locale in the environment, but that may be the default now. -- Robert Webb
On 2022-11-05 00:10, Maxwell Heeschen wrote:
Hey everyone,
I got this message, "maxwell is not in the sudoers file. This incident has been reported to the administrator." while trying to run some sudo commands after recently following the instructions to install Docker here: https://en.opensuse.org/Docker
...
I am running Tumbleweed.
Then read this: <https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/message/OCNDVHEI33BVSXI3AQVVQGI5HCI7N6C2/> -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
participants (4)
-
Carlos E. R.
-
Marco Calistri
-
Maxwell Heeschen
-
Robert Webb