document updated 12 years ago, on Jun 27, 2012
Various ways to forward X sessions to other computers.
when SSHing
Use ssh -X.
If you only want to do the X-forwarding, but don't want to keep the shell around, use ssh -fX.
To make this permanent (even on a per-host basis), put `ForwardX11 yes` in your ~/.ssh/config file.
when 'su'ing
when 'sudo'ing
Several different ways:
- sudox — wrapper script
- sudo sux accomplishes the same thing as sudox
- add Defaults env_keep += "DISPLAY" to /etc/sudoers
- gksudo — wrapper script
- manually do xauth list and then xauth add
[1]
[2]
[3]
[4]
[5] Various improvements to that include:
- request that the environment-variables be at least partially preserved via sudo -H and/or sudo -E
- xauth merge ~originaluser/.Xauthority
- ssh -X root@localhost
(this requires that you have permissions setup so that you can SSH to root only from localhost)
inside tmux/screen
see here
Double hop
Use xhost + before SSHing to the next host.
External links