How to make X applications run on local workstations after ssh -X then su -
From K12LTSP Wiki
If you use ssh -X to connect to the servers you might have difficulty runing applications as other users. The following is how to make X applications work after using SSH to connect to the remote server and then using su to run applications as a different user.
This link was via Google at http://wiki.bic.mni.mcgill.ca/index.php/X11AuthError
Contents |
[edit]
Information gathering
[edit]
Log into the remote server
[kmatson@mydesk]$ ssh -X root@someserver.somedomain [root@ltspserver]#
[edit]
Determine the hostname
[root@ltspserver]# hostname hatteras
[edit]
Determine the DISPLAY environment variable
[root@ltspserver]# echo $DISPLAY localhost:10.0
[edit]
Determine the xauthkey
[root@ltspserver]# xauth list || grep hatteras/unix:10 hatteras/unix:10 MIT-MAGIC-COOKIE-1 reallylonghexadecimalnumber
[edit]
Target user environment adjustment
[edit]
Su to target user
[root@ltspserver]# su - someuser [someuser@ltspserver]$
[edit]
Add the xauthkey to environment
If you have mouse support I strongly recommend you copy and paste the xauthkey into the following command.
[someuser@ltspserver]$ xauth add hatteras/unix:10 MIT-MAGIC-COOKIE-1 reallylonghexadecimalnumber [someuser@ltspserver]$ <--- no visible result
You should now be able to run any X application as the target user and have it display on your local workstation.
