[Skip Navigation] [Remove Frame] [CS320] [Text Version] remote.html Sat Dec 23 08:00:42 PST 2006

Contents


    How to Use a Remote X Windows Computer

      Problem

      You are running a UNIX windows box called Local and want to use one or more programs on another system called Remote.

      Summary


      1. Find out the name of your display -- A below
      2. Give Remote permission to use your display -- B below
      3. Login to Remote --- C below
      4. Tell the Remote where you are --- D below
      5. Use both the Remote and Local System --- E below
      6. Tidy up on Remote and come back to your machine -- F below

      Steps

        A

        Programs using the X Windows need to know which visual display unit(VDU) to use. They store the VDU's name in a variable called DISPLAY. Each VDU has a name like this:
         		machine_name:display_number
        For example
         		jbh300-1:0
        is the main VDU(number 0) on a computer called jbh300-1. By the way 'jbh300' means it is in room number 300 on the third floor of Jack Brown Hall. Many machines have recently had their names put on a label that is stuck to them.

        Finding the name of your DISPLAY


        1. Try this command:
           		echo $DISPLAY
          This puts the name of the display that you are using on the screen. If it looks like
           		name:0
          this is your DISPLAY.
        2. If it looks like this ":0" or nothing is printed then you must find out the name and number of your computer. Your Local machine's programs use the default console display of ":0". You need to find out you machine's ame.
          • Look for the paper label showing the name and number of your machine.
          • Try the command
             		hostname
            will (on many systems) show you the name of your computer. You add ":0" to it to get the main display screen on the computer.
          • Look at your UNIX prompt, it may be set up to include the name of your computer:
             		[auser@jbh???-?? adirectory]$
            The Local machine's name is jbh???-?? above.
          If you put a colon and a zero after Local hostname you will get the name of your DISPLAY.

        Take note of your DISPLAY ready for step D below.

        B

        Tell your Local system that it is OK for the Remote system to send windows to your Local machine:
         		xhost Remote
        Remote is now allowed to put windows on your computer's screen. This command can be used with any X Windows compatible machine on the Internet. Nearly all UNIX boxes on the Internet run X Windows. The command
         		xhost
        lists all the machines that can use your computer as a host for their windows. You can remove Remote with
         		xhost -Remote

        C

        Open a new window on Local that executes a "Remote Login':
         		xterm -e slogin Remote &

        Net
        1. The xterm command above creates a new window using a standard terminal emulator called an xterm. This window will be called Remote and will execute the slogin (secure login) command.
        2. slogin is a secure program that encrypts the data flowing between Local and Remote (including passwords) and positively vets to make sure that you are goin to the right machine. If you try to slogin to a machine you've not accessed before it will ask you to verify that the name is correct: answer
           		yes
          (answer like 'y' will not work!).
        3. If slogin doesn't run on your machine use rlogin instead. It is not secure but other wise works in the same way.
        4. Remote should ask you for your password in the ordinary way.

        (End of Net)

        By the way
        Net
          rlogin stands for Remote Login and it allows you to use one computer to do work on another computer. It lets you use a computer anywhere on the Internet where you have an account.
          slogin is not available everywhere yet. It is for secure encrypted remote logins.
        1. The & lets you continue working on yout Local machine as well as the Remote one.
        2. If both rlogin and slogin fail try the old but operational telnet command:
           		telnet Remote

        (End of Net)

        Note.

        D

        Tell the Remote machine where you are sitting. In the new window this command:
         		DISPLAY=your_display
        This binds your display name to the variable with name DISPLAY. Make sure this command has NO spaces!. It tells the Remote shell that Windows need to be sent to your_display. Use the your_dispaly from step C above.

        Then type in:

         		export DISPLAY
        The export command tells the shell on the Remote machine that it must export the DISPLAY variable and the value bound to it to the programs that you run on that machine.

        E

        You can now type any command in the xterm window and have it executed on Remote. Because it is an xterm you can run programs like vi, pico, pine, and elm that use an alphanumeric terminal. If they have a problem it is because they need
         		export TERM=xterm
        before they understand that you are using an xterm. Programs with graphics : Netscape, xeyes, xman, rose, and so on that use a graphic window will send it to your DISPLAY.

        F

        Close any windows that you may have running on the Remote machines. Be expecially careful to manually close any Netscape windows and if you've run 'rose', don't forget 'thorn'!

        Then input to Remote either:

         		exit
        or
         		logout
        This command terminates your rlogin command and closes the new window ( C above). You are still logged in on your own machine and can use it normally... don't forget to logout the usual way.

      . . . . . . . . . ( end of section Steps) <<Contents | End>>

      Notes

        .bash_profile

        I have found it worth while to program my login shell to ask me where I am to reduce typing by adding these lines to my .profile:
         		echo "Send DISPLAY to?"
         		read DISPLAY
         		export DISPLAY

        Another version is

         		echo "Where are you?"
         		read HOST; DISPLAY=$HOST:0
         		export DISPLAY HOST

        Using a Remote machine while on a Remote machine

        You do not repeat step B above since you already know your display. On your machine input the xhost(A) command and on either machine the xterm command(D).

        Sending a Display to a Remote System

        You can use the similar steps to send a window to a remote computer from your local machine. Run the xhost command on the remote machine and set the DISPLAY on your local one. However doing this is dangerous! You send both the image and the ability to use your computer in that window.

      File Transfers

      There is a standard Internet protocol for copying files from machine to machine that is available on any Internet compatible computer(even a DOS system) as the ftp program. It can be called with the name of a Remote system and has the following commands:
    1. ftp_commands::=following
      • open::=indicates the remote computer.
      • close::=terminates connection with Remote.
      • user::=logs a user in.
      • ascii::=sets ftp up for transfering text files.
      • binary::=sets ftp up to transfer binary (GIF, JPEG, EXE,...) files.

      • get::=gets a file from Remote.
      • put::=puts a Local file on to Remote.
      • del::=delete Remote file.

      • cd::=changes working directory on Remote.
      • lcd::=changes working directory on Local.
      • dir::=directory listing.
      • ls::=list directory.
      • mkdir::=make directory.

      • mget::=multiple get with wild cards.
      • mput::=multiple put with wild cards.
      • mdel::=multiple del with wild cards.

      • prompt::=stops/starts asking you about individual files in mget/mput/mdel.
      • verbose::=stops/starts giving long-winded responses to your command.

      Glossary

    2. DISPLAY::= A shell variable that names the machine and the the VDU on the machine where windows etc will appear.

    3. ftp::program=File Transfer Protocol. ftp can be used to copy files between computers on the Internet whatever operating system they use.

    4. Local::=the name used in this document for the machine you are currently running on.

    5. Network::= See http://csci.csusb.edu/dick/CSciNetwork.mdl.

    6. orion::=a Sun server that can be used on campus that can run Rational Rose.

    7. Remote::=the name of a different machine that you want to use.

    8. shell::= any program that interprets commands input by a user.

    9. VDU::=Visual Display Unit.

    10. exit::UNIX_command=Terminate session/shell. ( on some UNIXen).
    11. logout::UNIX_command=Terminate session.
    12. rlogin::UNIX_command=Remote Login.
    13. slogin::UNIX_command=Secure Remote Login.
    14. telnet::=command allowing remote access to any internet host and port.
    15. xhost::X_windows=add machine to access control list(ACL) for this machine.

    16. one_line_summary::= xhost; rlogin; use_it; terminate_it; exit.

    . . . . . . . . . ( end of section How to Use a Remote X Windows Computer) <<Contents | End>>

End