Re: gparted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On Sun, 08 Jun 2025 09:58:55 +0200 Patrick Dupre via users wrote:
>> I can get gparted to work after I "su" to root on
>> the remote machine.  (I see you used "sudo".)

> It works.

Right. This is because su forwards (properly) the xauth keys. It does
that by using pam_xauth (see man pam_xauth, /etc/pam.d/su).

You can also achieve that with sudo with:

  XAUTHORITY=${XAUTHORITY:-~/.Xauthority} sudo garted

but this assumes:

  - that root as the right to read the ~/.Xauthority file of the user.
    This will not be the case for example if the user homedir is
    under an NFS mountpoint.

  - that /etc/sudoers keeps the XAUTHORITY variable (it does on Fedora-42)
    if this is not the case, use: 

    XAUTHORITY=${XAUTHORITY:-~/.Xauthority} sudo -E garted

Setting XAUTHORITY is needed because 'ssh -X' uses the default:
~/.Xauthority but sudo (unlike pam_xauth) does not manage this case:
it only keeps the XAUTHORITY variable in the environment.

A more proper way to use sudo for that is thus:

  XAUTHORITY=${XAUTHORITY:-~/.Xauthority} sudo su root -c gparted

Ie: use su to properly forward the xauth keys.

This will work even in the case were root doen't have a password, as
su do not ask for a password if one is root already (see: pam_rootok).

-- 
francis
-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux