Sudo broken after using yast2-sudo

Hi, I was simply trying to makesudo zypper refpasswordless. As I remember to have done this with yast-sudo before, I installed the yast2 addon and made the change.
I don’t know if it’s me forgetting the right recipe or what, after I made the change, my sudo commands were limited to ‘zypper ref’ only. I couldn’t do things like sudo cat /etc/fstab. It would respond something like " ‘cat’ is not in the list of permitted commands with sudo".

Then I deleted the sudo rule in yast2-sudo (which had been empty before I adding any rule).

Now the symptom becomes: sudo with my username is not possible at all. It says my username is not in the sudo group.

I compared sudoer files/configurations to my other OSS TW installation. The working installation has no /etc/sudoer file and its folders and files at /usr/etc/sudo* are exactly the same with the problematic system.

So delete /etc/sudoers* to return to the default configuration.

1 Like

opensuse is really weird !!

Now how do we add certain command with sudo so it doesn’t require root password?

@bonedriven use /etc/sudoers.d/ for your files…

But why, if auto refresh is set, it gets refreshed every 10 minutes

I did not know this, I thought auto refresh is for when you open yast2 software management.

What if I want to add ‘zypper dup’ in the passwordless command list. I’d like to know how it’s done.
It was not hard before, using yast2-sudo. Did something change?

@bonedriven well the zypper command would be;

Filename: /etc/sudoers.d/01-zypper containing;

username ALL=NOPASSWD: /usr/bin/zypper

1 Like

Thank you. I’m learning how to do this manually. In the same time maybe someone may take a look at yast2-sudo addon. It may be broken…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.