/etc/sudoers and https://en.opensuse.org/SDB:Administer_with_sudo free of examples

I couldn’t remember if exists a best place to ask this, and didn’t find one when looking. :frowning:

I installed 15.1 on a brother’s PC, skipping user creation until such time as I could consult with him on the subject of passwd. Since having created one, I want to enable sudo for the created normal user account, but found no unambiguous examples of what to do in the file, or at $SUBJECT’s URL, in YaST2, or in the sudoers man page. :frowning:

Will someone please provide a clear example of how to add a username to /etc/sudoers, and clarify the SDB:?

Don’t you just add to the wheel group?

The only one I use for myself is building rpms with osc/sudo which is…

<username> ALL = NOPASSWD: /usr/bin/build

I don’t normally use “sudo”.

I think you need to uncomment this line:

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

Make that the second of those two lines.

Then you add the user to the “wheel” group.

Turns out I don’t understand the purpose of sudoers. Here on brother’s 15.1/Plasma PC, simply sudo fdisk -l and typing passwd in Konsole is enough as normal user, without having more than viewed /etc/sudoers.

For openSUSE, you usually don’t need to change “sudoers”. Anyone can use “sudo” provided that he/she knows the root password.

If you uncomment that line about “wheel”, then anyone in the “wheel” group can use “sudo” with their own password (no need for the root password).

I have experimented with adding: DISPLAY XAUTHORITY SSH_AUTH_SOCK
to the list of environment variables passed through. That allows me to use GUI applications with “sudo” and to use my public key (registered with “ssh-agent” to doing “rsync” between systems as root. But, except for the testing, I’ll probably never use it. It’s not my normal way of doing administrative things.