2.3. Starting a Remote, Text-Mode Unix Session

In this section, we'll concentrate on creating text-mode sessions with remote Unix machines. For CS Dept. students, these will be the Dept.'s Linux servers. Remote graphics-mode sessions will be introduced later.

ssh

We will be accessing the remote machines via ssh, an Internet protocol for issuing interactive text-mode commands to remote machines.

There is an older text-based protocol for giving commands to Unix called "telnet". telnet is still used for a variety of purposes, but has fallen out of favor because it sends everything (including your login name and password) in plain-text format, leaving you vulnerable to someone else on your network eavesdropping via "packet sniffers".

By contrast, ssh encrypts all your communications, so you are safe even if someone is eavesdropping.

ssh (secure shell) allows a person connected to the Internet to log into other machines on the Internet and to issue commands to those machines. To use ssh, you must have an ssh client program on the machine where you are seated, and you must know the name of a machine elsewhere that is running a ssh server, the program that accepts logins and subsequent commands from the client. [5]

The ODU CS Dept. runs a number of ssh servers. Prior to Fall 2011, these were all Sparc servers running the Solaris Unix operating system. The Dept. is now in the process of switching over to a collection of servers running Linux. You can find a list of these here. Expect this list to grow and change fairly often in the near future.

Be careful - you will probably find lots of references to the older machines (sometimes referred to as the "fast" machines) in various places on the Dept. website. However, because these older machines are being phased out, in this course we will make exclusive use of the newer Linux machines.

Login Accounts

You will, of course, only be able to connect to machines where you actually have a login account. If you are a student registered for a CS course at ODU, and have never had a Unix account on the CS Dept system, you can get your account by going to the CS Dept home page and clicking on the Account Creation link (under Online Services).

If you have had an account in the recent past, it should be regenerated for you in any semester when you are registered for a CS course. Otherwise, you will need to contact your instructor or from the CS systems staff to get your account.

Remote Text-Mode Sessions from a Windows Machine

On a Windows PC (without CygWin), you will need an ssh client program. If you are on your own PC, you can choose the client program to install and run. If you are on a lab PC, at work, or for some other reason using someone else's machine, you either need to use whatever they have installed or bring your own client program, probably on a USB flash drive.

Connecting via PuTTY

Run the PuTTY program. You will be presented with a session dialog box like the one shown here. For the "Host Name", fill in the name of the ssh server machine that you chose earlier. For the "Connection Type", make sure that "SSH" is selected. Then click "Open".

The first time you connect to any machine, you will get a rather intimidating warning that "The server's host key is not cached in the registry" followed by a lot of details that uniquely identify the machine you are connecting to. This is a way ssh tries to protect you against people trying to capture your login info by "spoofing" or impersonating a legitimate machine. In practice, you're not likely to know whether this info is correct or not, so click "Yes" to proceed with the connection.

If you get a similar message later when reconnecting to a machine you have previously used, that might be suspicious (or it may just mean that the original machine crashed and has been replaced by a different one that was given the same name on the network.

You should now be prompted for your login name. You are ready to log in.

Remote Text-Mode Sessions from a Linux, MacOS or Windows-with-Cygwin Machine

All Linux and MacOS machines should include the ssh client program, ssh. On a Windows machine with CygWin, this is an optional package. If you have not installed (or are not sure if you did), run the CygWin installer and select it for installation from the "Network" section.

First, you will need to open a local text-mode session on your machine.

Then from within that session, give the command

ssh -l yourLoginName sshServerName 

filling in your CS Unix login name and the name of the ssh server machine you chose earlier (including the .cs.odu.edu ending).

The first time you connect to any machine, you will get a rather intimidating warning such as "The authenticity of host ... can't be established" followed by a lot of details that uniquely identify the machine you are connecting to. This is a way ssh tries to protect you against people trying to capture your login info by "spoofing" or impersonating a legitimate machine. In practice, you're not likely to know whether this info is correct or not, so reply "yes" to proceed with the connection.

If you get a similar message later when reconnecting to a machine you have previously used, that might be suspicious (or it may just mean that the original machine crashed and has been replaced by a different one that was given the same name on the network.

You should now be prompted for your login name. You are ready to log in.



[5] This is a very common pattern when working over networks. Server programs on one machine offer a service, that client programs, usually on different machines, can request. Each different kind of service requires a different server & client program. ssh provides text and command services. We will later see other client-server arrangements for file transfer, email, and graphics display.