[K12OSN] Solution to make X applications work after ssh -X then su -

Kevin Matson kmatson at pps.k12.or.us
Fri Jun 10 19:44:18 UTC 2005


The following is a cool solution and not a question. 
 
  At PPS we have many Linux labs spread across different buildings in
the district. Therefore it behooves us to remotely administer and
troubleshoot the LTSP servers. We use ssh -X to connect to the servers
and run applications as the users. Our teachers have unique/ unknown
passwords as do some of our students. We had a need to be able to ssh to
a server, su into another user, and run applications as that user while
displaying the video on our local workstation. This is how we were able
to make it work. 
  Credit where credit is due, I found this via google at
http://wiki.bic.mni.mcgill.ca/index.php/X11AuthError . 
 
Information gathering phase: 
 
* First log into the remote server. 
[kmatson at mydesk]$ ssh -X root at someserver.somedomain 
[root at ltspserver]# 
 
 
* Determine what the hostname is. 
[root at ltspserver]# hostname 
hatteras 
 
* Determine what the DISPLAY environment variable is. 
[root at ltspserver]# echo $DISPLAY 
localhost:10.0 
 
*  Determine what xauthkey to use 
[root at ltspserver]# xauth list | grep hatteras/unix:10 
hatteras/unix:10  MIT-MAGIC-COOKIE-1  reallylonghexadecimalnumber 
 
 
Target user environment adjusting phase: 
 
* Su to target user. 
[root at ltspserver]# su - someuser 
[someuser at ltspserver]$ 
 
* Add the xauthkey to their environment. If you have mouse support I
strongly recommend you copy and paste the xauthkey into the following
command. 
[someuser at ltspserver]$ xauth add hatteras/unix:10  MIT-MAGIC-COOKIE-1 
reallylonghexadecimalnumber 
[someuser at 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. 
 
 
Cheers, 
  Kevin M. 


-------------------------

Kevin Matson
IT - Lab Team
kmatson at pps.k12.or.us
503-916-2000 x4960
503-916-3375

Portland Public Schools


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20050610/6200071e/attachment.htm>


More information about the K12OSN mailing list