Running remote programs

Example of running a remote client on your display

This section provides a comprehensive example that ties together many of the concepts and procedures discussed in this chapter.

For the purposes of this example, let's assume you have accounts on two SCO OpenServer machines: one that sits on your desk, named boston, and another, named tusconey, that resides in another room. The two machines are part of the same network, and their names and IP addresses are listed in each other's /etc/hosts files. You have root privileges on boston, but you do not have root privileges on tusconey. Your account name is the same on both machines. You are accustomed to using the clients installed on boston from the default server running on tty02. You just received mail that on the machine tusconey there is a nicely-configured version of the desktop client, xdt3, and you want to try it out.

This example explains how to:

The following steps result in tusconey's Desktop client displaying on your X server on boston:

  1. On boston, switch to tty01 by pressing <Ctrl><Alt><F1>.

  2. Log into boston as root.

  3. Log into tusconey remotely, using the rlogin command. When prompted, enter your login name and password.

  4. On tusconey, edit the .rhosts file in your home directory, or if that file does not exist, create it. Add the following line:

    boston username

    In this command, username is your login name. When you have finished, save and exit the file. You have established user equivalence on tusconey. You can now log off tusconey.

  5. Back on boston, change to the /etc directory and open the X0.hosts file for editing. If X0.hosts contains any host machine names, remove them or comment them out with ``#'' characters. When you have finished, save and exit the file.

  6. Change to the /usr/lib/X11/scologin directory and edit the Xconfig file. If the DisplayManager*authorize resource is not defined as ``true,'' or if it is not listed at all, add the following line:

    DisplayManager*authorize: true

    When you have finished, save and exit the file.

  7. If you modified the contents of /usr/lib/X11/scologin/Xconfig, run scologin stop, then run scologin start.

    NOTE: This script shuts down all scologin processes on your system, which results in the closure of any Graphical Environment sessions running at that time. You should notify users before you actually stop scologin.

  8. Switch to tty02 by pressing <Ctrl><Alt><F2>.

  9. When the scologin window appears, start a ``failsafe'' session. Log in by typing your user login and password in the appropriate fields, then press <F1> instead of a carriage return. This starts a failsafe session instead of running a default session managed by scosession. The failsafe session consists of only a scoterm window. The window manager and Desktop are not started. For more details on failsafe sessions, see the scologin(XC) manual page.

  10. Type the following command in the scoterm window:

    xauth list

    The result is a list of servers for which you have authorization records. The line beginning with ``boston:0'' indicates that you have authorization to your local X server.

  11. To authorize your account on tusconey to access your display, run the following command:

    xauth extract - boston:0|rcmd tusconey /usr/bin/X11/xauth merge -

    If the .Xauthority file does not already exist, the following message appears:

       /usr/bin/X11/xauthority: creating new authority file username/.Xauthority
    In this message, username is your login name.

  12. To make sure the authorization code was successfully transferred to your account on tusconey, run the following command:

    rcmd tusconey /usr/bin/X11/xauth list

    The line beginning with ``boston:0'' indicates that your account on tusconey has authorization to access your X server.

  13. Log in to tusconey with the following command:

    rlogin tusconey

    Note that you are not prompted for a password because you have user equivalence on tusconey. When you are logged in, run the following commands:

    export DISPLAY PATH
    scosession 2>/dev/null &

    When the Desktop appears, double-click on the UNIX icon to open a scoterm window. In the window, run hostname to verify that you are using tusconey's filesystem.

    When you are done using the Desktop, exit through the File menu.

The preceding steps only apply to your current X session. If you want to make these changes take effect every time you start a session, you must reauthorize your account as shown in Step 11 above. You can do this automatically by placing the command given in Step 11 in the file $HOME/.startxrc.

NOTE: In the steps above, you logged in using the failsafe login. When you exit the original ``failsafe'' window, this will not only close that window but also end your current X session.

Previous topic: Running clients with the -display option

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003