Disabling or reducing Yast Password Prompts

Is there any single way to disable Yast Password prompts? I’m the only user of Desktop (Opensuse Leap 15.5), and no one else accesses machine. I often (very often) need to perform system operations - Yast do that but it burns the life with every-time asking password.

Is there a way to disable Yast Super User Password Prompts? Or at-least reduce it to 1 time per login?

Keep the YaST main window open?

It is BTW not YaST that asks for it, it is the interface program from your desktop (and you failed to mention which one that is) that asks.

And indeed it should not be needed to use YaST that often, thus they did not really address your way of living.

In my case, every time I have to provide the root password I say to myself: “a really safe operating system!”

3 Likes

Thank you @hcvv . Actually I’m a web developer and I need to refer to Yast often for software management, configurations of servers and virtual machines and lot more. I really use Opensuse for Yast managements.

Keeping Yast should be the option, but unwillingly one would try to quit and window after its operation is done - that’s why it is a routine to close it soon after task is done.

If you look in how Yast is started from the GUI you see that is done using:

/usr/bin/xdg-su -c /sbin/yast2

You could try giving xdg-su setuid root rights but be sure you understand what this is doing.

You can do that. However (applies to any privileged action): Why polkit (or, how to mount a disk on modern Linux)

2 Likes

@marel Thanks for your response. I admit your warns regarding “Knowing What I Am Going To Do”.
Can you please provide a snippet or shell command to run to get out of it? yast2 is located in /usr/sbin/yast2. Also, since I use NOPASSWD in sudoers, that doesn’t work - since running with sudo drops it to command line interface and --gtk or --qt seems to be ignored.

How to do it is already described in my previous post.

Just search for “setuid root” to educate yourself.

You can configure “sudo” to pass on “$DISPLAY” to the root environment.

1 Like

It will lead to Authorization required, but no authorization protocol specified.
i.e:sudo --preserve-env=DISPLAY yast2 --gtk will lead to above error.

Thank you @marel . Most definitly I’m tyring to Do it myself.

Fortunately, it is not possible for shell scripts.

1 Like

You probably need to also pass $XAUTHORITY to the root environment.

1 Like

Great, it finally worked with a combination of passing DISPLAY and XAUTHORITY.
Wrapping up, it works as 0) NOPASSWD in sudoers, 1) sudo --preserve-env=DISPLAY,XAUTHORITY yast2 --gtk.

1 Like