xauth is an X Window utility for displaying locally the output of an X Window application running remotely. xauth serves the same purpose as the older xhost utility, but is considered far more secure. Under xauth a 'magic cookie', encoding information about your password and your current login session, must be found in the home directories of both your local and remote machines before one machine can display remotely on the other. This 'cookie' is stored in a file in your home directory called .Xauthority. Note that because this file is basically a password to your X Window display you must not give it group or world read or write permissions. The correct permissions for this file are read and write for you only, or 600 in octal. The presence of other than 600 permissions is cause for immediate account inactivation.
Since all ARSC SGI workstations (with the exception of grizzly) share the same NFS-mounted home directories, the .Xauthority file is visible to each machine, and the process of setting up a remote display is as simple as setting your DISPLAY variable. To run an X Window application on onyx2 and have it display on indigo43, for example, you would take the following steps:
on indigo43:
indigo43> rlogin onyx2 [initiate onyx2 session]
on onyx2:
onyx2> setenv DISPLAY indigo43.arsc.edu:0 [csh] or
onyx2> export DISPLAY=indigo43.arsc.edu:0 [ksh]
The procedure for remote displays between two machines not sharing the same home directory is more involved, since it is necessary to transfer the 'magic cookie' from one machine's .Xauthority file to the other's. This can be done relatively simply, however, if you can run a remote shell on the remote machine. Generally, for non-ARSC systems, this would require that you have an .rhosts file in your home directory on the remote machine with an entry consisting of your local machine name and userid. ARSC systems use kerberos for authentication and do not need .rhost files. Then to run an X Window application on chilkoot, and have it display on indigo43, for example, you would take the following steps:
on indigo43:
indigo43> xauth nextract - indigo43.arsc.edu:0 | /usr/local/krb5/bin/krsh chilkoot.arsc.edu '/usr/bin/X11/xauth nmerge -'
********************************************************************
alternatively, and more simply, you can use a local script (in
/usr/local/bin) developed to accomplish the above:
indigo43> exauth chilkoot.arsc.edu <your userid>
********************************************************************
indigo43> krlogin chilkoot
on chilkoot:
chilkoot> setenv DISPLAY indigo43.arsc.edu:0 [csh] or
chilkoot> export DISPLAY=indigo43.arsc.edu:0 [ksh]
To run an X Window application on a non-ARSC machine, and have it display on indigo43, for example, you would take the following steps:
on indigo43:
indigo43> xauth nextract - indigo43.arsc.edu:0 | /usr/bsd/rsh aurora.alaska.edu '/usr/bin/X11/xauth nmerge -'
indigo43> rlogin aurora.alaska.edu
on aurora:
aurora> setenv DISPLAY indigo43.arsc.edu:0 [csh] or
aurora> export DISPLAY=indigo43.arsc.edu:0 [ksh]
add the following line to your .cshrc file:
setenv PATH ${PATH}:/usr/bin/X11
then cause your change to take effect:
source .cshrc
add the following line to your .profile file:
export PATH=${PATH}:/usr/bin/X11
then cause your change to take effect:
. .profile
As in the previous case, it is necessary to transfer the magic cookie from one machine's .Xauthority file to the other's. Without the ability to open a remote shell on the remote machine, you will have to move the cookie over manually and merge it into the remote machine's .Xauthority file. To run an X Window application on video1 and have it display on grisly.cameron.edu, for example, you would take the following steps:
on grisly:
grisly> xauth [initiate xauth session]
xauth> nextract cookie grisly.cameron.edu:0 ['cookie' is arbitrary]
xauth> exit [terminate xauth session]
grisly> ftp video1.arsc.edu [initiate ftp session]
ftp> put cookie [transfer cookie file]
ftp> bye [terminate ftp session]
grisly> rm cookie [clean up]*
grisly> telnet video1.arsc.edu [initiate video1 session]
on video1:
video1> xauth [initiate xauth session]
xauth> nmerge cookie [put cookie in .Xauthority]
xauth> exit [terminate xauth session]
video1> rm cookie [clean up]*
video1> setenv DISPLAY grisly.cameron.edu:0 [csh] or
video1> export DISPLAY=grisly.cameron.edu:0 [ksh]
* Note that the cookie file contains all the information needed to access your X Window display. This is the reason why it should be deleted after use, or at a minimum checked to ensure that only you have read and write permissions for this file (octal 600).
add the following line to your .cshrc file:
setenv PATH ${PATH}:/usr/bin/X11
then cause your change to take effect:
source .cshrc
add the following line to your .profile file:
export PATH=${PATH}:/usr/bin/X11
then cause your change to take effect:
. .profile