SSH X11 Tunnel su - lost cookie to non-root user

From: Hans (hans753_at_hotmail.com)
Date: 10/19/04


Date: 19 Oct 2004 08:33:57 -0700

Hello,

Yes I've googled around, but didn't find the perfect solution.

I want to connect to X11 via a shh tunnel and then do a "su -
non-root-user".
What is the best way to save the cookie?

$ echo $DISPLAY
localhost:10.0
$ xauth list | grep ':10'
xserver/unix:10 MIT-MAGIC-COOKIE-1 12345678901234567896012345678901
$ su - non-root
Password:
$ export DISPLAY=localhost:10.0
How to get the cookie to the new user with xauth merge?

The real problem, how to do it automaticly.
Should I protect the cookie against other users? Or can I just copy it
to /tmp to be read by the su-user?

Greets Hans



Relevant Pages

  • Re: SSH X11 Tunnel su - lost cookie to non-root user
    ... but didn't find the perfect solution. ... >$ echo $DISPLAY ... >How to get the cookie to the new user with xauth merge? ...
    (comp.security.ssh)
  • Variable in Array
    ... Is it possible to put Variable in Array? ... I need to display some data based on array content. ... echo 'data that should be display based on array value. ... data in array because array is stored in cookie and then read'; ...
    (comp.lang.php)
  • Re: xhost +localhost
    ... > No, in fact, xhost needs the DISPLAY variable already set so that it ... > knows which display to try and connect to to change access control. ... allows anyone to access the X server through unix domain sockets. ... > the cookie is then sends it to the X server to authenticate itself. ...
    (freebsd-questions)
  • Re: [PHP] No cookie is being set?
    ... Why not just echo the ID var separately? ... didn't use the array quotes as Larry mentioned. ... www.healthtvchannel.org "Cesar Aracena" wrote in message ... No cookie is being set? ...
    (php.general)
  • Re: x11 forwarding after becoming another user on SecureCRT
    ... (Type `echo $DISPLAY' to see what the DISPLAY ... command to read and write cookies in the cookie file. ... You can tell xauth which file to use ...
    (comp.os.linux.security)