Xauthority location: only per-user setting possible

Jim Knoble jmknoble at pobox.com
Tue Jul 10 08:18:51 EST 2001


Circa 2001-Jul-09 17:08:50 -0400 dixit James Ralston:

: I think a better solution (and one more in tune with the desires of
: the OpenSSH maintainers) would be to have OpenSSH capture the stdout
: of $HOME/.ssh/rc and process it in exactly the same way as
: $HOME/.ssh/environment.  That would permit one to construct a
: $HOME/.ssh/rc like the following:
: 
:     #! /bin/sh
:     read proto cookie
:     [ "x${proto}x" = xx ] && exit 1
:     [ "x${cookie}x" = xx ] && exit 1
:     XAUTHORITY="`mktemp /tmp/username-ssh-cookie-XXXXXX`" || exit 1
:     # If "echo" isn't a builtin, this exposes your cookie to ps(1)!
:     echo add ${DISPLAY} ${proto} ${cookie} | xauth -q - || exit 1

This would probably work better:

      xauth -q -f "${XAUTHORITY}" - <<EOF
      add ${DISPLAY} ${proto} ${cookie}
      EOF
      [ $? -eq 0 ] || exit 1

Using the here-document keeps things from appearing in ps no matter
what kind of system you've got.  And, if XAUTORITY isn't exported, then
xauth won't pick it up.

-- 
jim knoble | jmknoble at jmknoble.cx | http://www.jmknoble.cx/
           | jmknoble at pobox.com   | http://www.pobox.com/~jmknoble/
(GnuPG fingerprint: 31C4:8AAC:F24E:A70C:4000::BBF4:289F:EAA8:1381:1491)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 249 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20010709/489bb51a/attachment.bin 


More information about the openssh-unix-dev mailing list