• X client from Wayland to X11 through ssh

    From Eben King@21:1/5 to All on Fri Apr 4 18:10:01 2025
    Hi. I have this machine "alexandria" onto which I installed Debian
    yesterday:

    eben@alexandria:~$ cat /etc/debian_version
    12.10

    It has a video card and a keyboard, but to log in there I have to get
    down on the floor, so I usually access it via ssh. Right now I'm trying
    to use synaptic to install some software, but I get this when I try as me:

    ,--
    | eben@alexandria:~$ synaptic-pkexec
    | ==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ====
    | Authentication is required to run the Synaptic Package Manager
    | Authenticating as: root
    | Password:
    | polkit-agent-helper-1: error response to PolicyKit daemon:
    | GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for
    |cookie
    | ==== AUTHENTICATION FAILED ====
    | Error executing command as another user: Not authorized
    |
    | This incident has been reported.
    | eben@alexandria:~$
    '--

    As root it's even shorter:

    ,--
    | root@alexandria:~# synaptic
    | Failed to initialize GTK.
    |
    | Probably you're running Synaptic on Wayland with root permission.
    | Please restart your session without Wayland, or run Synaptic without
    | root permission
    | root@alexandria:~#
    '--

    xev works as not-root, so X clients in general work. So how do I get
    around this? Installing not-Wayland is an option, but I probably should replace it with some WIMP interface so if I need it, it's there. Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From George at Clug@21:1/5 to All on Fri Apr 4 22:50:01 2025
    Hi,

    I believe you are using a terminal from another computer, and not using a remote X or Wayland client like VNC? (e.g. "I usually access it via ssh")

    If so, please use apt to install software.

    for example, become root
    $ sudo -i or just su (which is what I use) $ su
    After logging in as root

    # apt install <packagename>

    or to update the currently installed packages
    # apt update
    # apt full-upgrade --autoremove -y

    If you need to reboot to complete the installation
    # systemctl reboot

    to run synaptic you would need to do this on the computer itself, not remotely unless you are using a remote X or Wayland client like VNC.

    Apologies if I have misunderstood your question.

    George.




    On Saturday, 05-04-2025 at 03:07 Eben King wrote:
    Hi. I have this machine "alexandria" onto which I installed Debian yesterday:

    eben@alexandria:~$ cat /etc/debian_version
    12.10

    It has a video card and a keyboard, but to log in there I have to get
    down on the floor, so I usually access it via ssh. Right now I'm trying
    to use synaptic to install some software, but I get this when I try as me:

    ,--
    | eben@alexandria:~$ synaptic-pkexec
    | ==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ====
    | Authentication is required to run the Synaptic Package Manager
    | Authenticating as: root
    | Password:
    | polkit-agent-helper-1: error response to PolicyKit daemon:
    | GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for
    |cookie
    | ==== AUTHENTICATION FAILED ====
    | Error executing command as another user: Not authorized
    |
    | This incident has been reported.
    | eben@alexandria:~$
    '--

    As root it's even shorter:

    ,--
    | root@alexandria:~# synaptic
    | Failed to initialize GTK.
    |
    | Probably you're running Synaptic on Wayland with root permission.
    | Please restart your session without Wayland, or run Synaptic without
    | root permission
    | root@alexandria:~#
    '--

    xev works as not-root, so X clients in general work. So how do I get
    around this? Installing not-Wayland is an option, but I probably should replace it with some WIMP interface so if I need it, it's there. Thanks.



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eben King@21:1/5 to George at Clug on Fri Apr 4 23:10:01 2025
    On 4/4/25 16:41, George at Clug wrote:
    Hi,

    I believe you are using a terminal from another computer, and not using a remote X or Wayland client like VNC? (e.g. "I usually access it via ssh")

    That is correct, ssh in bash in xfce4-terminal in XFCE in X11 under
    kernel 6.1.0-32-amd64.

    If so, please use apt to install software.

    If you need to reboot to complete the installation
    # systemctl reboot

    shutdown doesn't. I mean it acts like it does, goes through the
    motions, and ends up with a computer that's unresponsive and off the
    network, but fans & drives are still spinning. "poweroff" works, but I
    don't know if it shuts down the OS gracefully or is equivalent to
    pulling the plug. Also it suspends the OS after a few minutes, so I
    gotta find out where that's controlled.

    to run synaptic you would need to do this on the computer itself, not remotely unless you are using a remote X or Wayland client like VNC.

    So ssh is right out? That sucketh much. It's not all X clients that
    don't work, so what's the determinant for not working? Those that use
    root? GTK?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to Eben King on Sat Apr 5 00:10:01 2025
    On Fri, 4 Apr 2025 17:00:09 -0400
    Eben King <eben@gmx.us> wrote:

    to run synaptic you would need to do this on the computer itself,
    not remotely unless you are using a remote X or Wayland client like
    VNC.

    So ssh is right out? That sucketh much. It's not all X clients that
    don't work, so what's the determinant for not working? Those that use
    root? GTK?

    Not necessarily. I routinely ssh into all my computers, to their root
    and user accounts, and then use GUI programs which display properly on
    the machine from which I SSHed in. The trick is in setting up your
    target computer's ~/.ssh/config correctly. E.g:

    host dragon
    Protocol 2
    ForwardX11 yes
    ForwardX11Trusted yes

    and similarly for the target's /root/.ssh/config.

    This may also involve setting up the target's /etc/ssh/sshd_config
    correctly; I don't remember.

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eben King@21:1/5 to Charles Curley on Sat Apr 5 00:20:01 2025
    On 4/4/25 18:08, Charles Curley wrote:
    On Fri, 4 Apr 2025 17:00:09 -0400
    Eben King <eben@gmx.us> wrote:

    to run synaptic you would need to do this on the computer itself,
    not remotely unless you are using a remote X or Wayland client like
    VNC.

    So ssh is right out? That sucketh much. It's not all X clients that
    don't work, so what's the determinant for not working? Those that use
    root? GTK?

    Not necessarily. I routinely ssh into all my computers, to their root
    and user accounts,

    So you ssh-login as root, or do you login as a user then su to root?

    and then use GUI programs which display properly on
    the machine from which I SSHed in. The trick is in setting up your
    target computer's ~/.ssh/config correctly. E.g:

    host dragon
    Protocol 2
    ForwardX11 yes
    ForwardX11Trusted yes

    That last line might be the critical one. I'll check next time I boot
    whether that does the trick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to Eben King on Sat Apr 5 03:40:02 2025
    On Fri, 4 Apr 2025 18:13:40 -0400
    Eben King <eben@gmx.us> wrote:

    Not necessarily. I routinely ssh into all my computers, to their
    root and user accounts,

    So you ssh-login as root, or do you login as a user then su to root?

    I log in as root. "ssh root@dragon.example.com".

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eben King@21:1/5 to Eben King on Sat Apr 5 23:40:02 2025
    On 4/4/25 17:00, Eben King wrote:


    Also it suspends the OS after a few minutes, so I
    gotta find out where that's controlled.

    /etc/gdm3/greeter.dconf-defaults looks to be a likely candidate, as in

    https://unix.stackexchange.com/questions/748759/disabling-suspend-etc-on-debian-12

    I changed it like so:

    # Automatic suspend
    # =================
    [org/gnome/settings-daemon/plugins/power]
    # - Time inactive in seconds before suspending with AC power
    # 1200=20 minutes, 0=never
    sleep-inactive-ac-timeout=0

    and restarted gdm:

    root@alexandria:~# systemctl restart gdm3

    so I'll see if that did the trick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anssi Saari@21:1/5 to Eben King on Sun Apr 6 18:00:02 2025
    Eben King <eben@gmx.us> writes:

    xev works as not-root, so X clients in general work. So how do I get
    around this? Installing not-Wayland is an option, but I probably should replace it with some WIMP interface so if I need it, it's there. Thanks.

    So, as xev works, X forwarding works and it's not your problem. While I
    don't use Synaptic it seems to me your problem is covered e.g. here: https://askubuntu.com/questions/1243897/pkexec-authentication-fails-over-ssh-x11-forwarding-why

    You could try sudo synaptic-pkexec or run /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1& before
    running synaptic-pkexec.

    My experience with GUI apps remotely as root is limited to gparted and
    it works with sudo, although I've usually had to fiddle with xauth
    first.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)