SUSE Support

Here When You Need Us

Using YaST graphical with sudo from GNOME

This document (000020963) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Desktop 15 SP4
SUSE Linux Enterprise Desktop 15 SP3
SUSE Linux Enterprise Desktop 15 SP2
SUSE Linux Enterprise Desktop 15 SP1
SUSE Linux Enterprise Desktop 15
SUSE Linux Enterprise Server 15 SP4
SUSE Linux Enterprise Server 15 SP3
SUSE Linux Enterprise Server 15 SP2
SUSE Linux Enterprise Server 15 SP1
SUSE Linux Enterprise Server 15

Situation

In SLES 15  Gnome Desktop environment it is not possible to start YaST GUI using normal user which has sudo rights.
If a normal user with sudo rights tries to open YaST from GNOME by selecting the YaST icon,  the application will always ask for the root password.

Resolution

In /etc/sudoers file add DISPLAY and XAUTHORITY at the end of the line that starts with Defaults env_keep = "LANG LC_ADDRESS.." :
Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE DISPLAY XAUTHORITY"
This allows a regular user with sudo rights to start YaST2 graphical from the terminal using the normal user's password:
sudo yast2

Cause

In the GNOME Desktop, accessing YaST using the YaST application icon, always prompts for root password because the desktop file makes use of xdg-su which uses su and not sudo

Additional Information

https://documentation.suse.com/sles/15-SP4/html/SLES-all/cha-yast-gui.html
https://manpages.opensuse.org/Tumbleweed/sudo/sudoers.5.en.html
https://en.opensuse.org/SDB:Administer_with_sudo

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020963
  • Creation Date: 03-Feb-2023
  • Modified Date:01-Mar-2023
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.