Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Automatically adding local user to xhost list?

  1. #1

    Default Automatically adding local user to xhost list?

    On Ubuntu, the local user is automatically added the xhost list when logging in (via a script in /etc/X11/Xsession.d).

    Is there a way to enable this in OpenSUSE?

    (My original problem is that I cannot interact with a running X session when loggin in via SSH, since newer GDM versions don't create $HOME/.Xauthority any longer.)

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,676
    Blog Entries
    3

    Default Re: Automatically adding local user to xhost list?

    You can still create $HOME/.Xauthority and use that.

    I'm not quite sure what you are doing. I assume that you are trying to export your xauth cookie over an ssh channel, then setting DISPLAY, but X still does not work. Try also setting $XAUTHLOCALHOSTNAME in the environment of the user you are logging in as. That was the change that I found was needed to get it working.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  3. #3

    Default Re: Automatically adding local user to xhost list?

    If you're logging in through ssh, we're not talking about 'local' user. You can add other computers to /etc/X0.hosts (create this file if needed) and/or issue xhost + <your ssh client> on the server, then export DISPLAY on the client ... if that's what you are trying to do.

  4. #4

    Default Re: Automatically adding local user to xhost list?

    SSH has Xforwarding built in ether via the ~/.SSH/config or simply using SSH -x or ssh -X (I forget the case). Don't set the DISPLAY variable, it will be already set correctly. System wide config is done in /etc/SSH/SSH.conf
    Xhosts method was used for telnet an rsh which are very insecure.

  5. #5

    Default Re: Automatically adding local user to xhost list?

    If security matters than you would use trusted X11 forwarding with -Y (not -X).

  6. #6

    Default Re: Automatically adding local user to xhost list?

    @please_try_again, dwellen:
    That is not what I'm trying to do... I'm trying to connect to an X session running on the SSH host, ie:
    Code:
    ssh username@host
    ...
    DISPLAY=:0 xterm
    Quote Originally Posted by nrickert View Post
    You can still create $HOME/.Xauthority and use that.
    I guess I'll write a script then that I'll run once per machine, which finds the GDM cookie and copies it to $HOME/.Xauthority... beats running "DISPLAY=:0 xhost +SI:localuser:username" as root every time I log in ;-)

    Still, I'd prefer a solution that is agnostic to the particular session type used on the machines...

  7. #7

    Default Re: Automatically adding local user to xhost list?

    Why don't you try to run an NX (No Machine or FreeNX) server on your SSH host? ... or you can remote login with xdm (using X -query) . I read somewhere that XDMCP support had been removed from GDM. But NX is a lot better (safer, faster) than XDMCP.

    * Maybe that's the problem: Ubuntu might have reimplemented XDMCP in GDM ... while openSUSE did not (?)

  8. #8

    Default Re: Automatically adding local user to xhost list?

    Quote Originally Posted by nrickert View Post
    Try also setting $XAUTHLOCALHOSTNAME in the environment of the user you are logging in as. That was the change that I found was needed to get it working.
    Turns out I also need to do this, setting XAUTHORITY (or copying the cookie) alone does not do the trick!

    This is rather annoying... :-/

  9. #9

    Default Re: Automatically adding local user to xhost list?

    Quote Originally Posted by chenz View Post
    @please_try_again, dwellen:
    That is not what I'm trying to do... I'm trying to connect to an X session running on the SSH host, ie:
    Code:
    ssh username@host
    ...
    DISPLAY=:0 xterm

    I guess I'll write a script then that I'll run once per machine, which finds the GDM cookie and copies it to $HOME/.Xauthority... beats running "DISPLAY=:0 xhost +SI:localuser:username" as root every time I log in ;-)

    Still, I'd prefer a solution that is agnostic to the particular session type used on the machines...
    Setting the DISPLAY variable before logging it to a remote system won't do anything.

    Use SSH -x (remote system name) term

    This will start term on the remote system but display it on the local screen. Heather the DISPLAY or xhosts is used. Display variable is set to the tunnelsetup by SSH.

  10. #10

    Default Re: Automatically adding local user to xhost list?

    Looking at it again it seams you want to attach to the remote systems display? This is called root
    window access which requires nx or vnc. Normally it's not configured.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •