Skip to content

Instantly share code, notes, and snippets.

@dmacvicar
Created July 17, 2013 08:42
Show Gist options
  • Save dmacvicar/6018883 to your computer and use it in GitHub Desktop.
Save dmacvicar/6018883 to your computer and use it in GitHub Desktop.
X forwarding after su - while in ssh -X
$ ssh root@host
$ echo $DISPLAY
localhost:10.0
$ xauth list
host/unix:10 MIT-MAGIC-COOKIE-1 f845ff6b6707bda93db8a76f4ebd7c66
host/unix:11 MIT-MAGIC-COOKIE-1 344dbd2a692ca55a90d4b8c040b59499
$ su - user
$ export DISPLAY=localhost:10.0
$ xauth add host/unix:10 MIT-MAGIC-COOKIE-1 f845ff6b6707bda93db8a76f4ebd7c66
$ startprogram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment