p
Search IT&E Labs:

Powered by Google
HomeResourcesPoliciesLab(s) ScheduleFAQ'sMeet the staffContact Us
/ Home / faqs / ssh
FAQ's::SSH (Telecompute and transfer files)

Connecting to another computer system:

Basics top

How do I connect to the school computers from home (or another lab) or transfer files?

If you are using your own computer, it must be configured so it can connect to the network. Refer to the ITU Support Center's Online Help section for 'Internet' or their Document section for the Student IT Guide.

You can connect from one computer to another by using the command line for text entry or by a graphical interface. The first examples are a command-line example from a linux PC, and it is followed by how to connect using SSH Secure Shell for Windows. Then we give examples of file transfer with scp (secure copy) in linux/unix and with the drag-and-drop scp feature in SSH Secure Shell for Windows. Finally, we look at some advanced and convenient features. Essentially, ssh/scp opens a secure channel from the computer where you started the ssh/scp command to another computer, and it encrypts the data that passes between them. (The arrows in this diagram show the from-computer-to-computer connections in the example. Data goes in both directions.

[diagram of SSH connections home to mason to IT&E cluster]

Command-line sessions top

Command-line ssh in Unix/Linux top

Here's a command-line example connecting from linux on a home PC to my account on osf1.gmu.edu in the mason cluster and then from there to my account on the IT&E cluster. (The username is astudent for the example, and specified as username@hostname in the ssh command because my knoppix linux username is different than my mason cluster username--it is not an e-mail address.)

knoppix@1[knoppix]$ ssh astudent@osf1.missed-spam@<-->gmu.edu

|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|

Password:    (the password does not display as it is typed)
Last login: Tue Sep 18 16:36:30 2007 from ip68-100-12-34.

            
... Be sure to read the notices!

2/12/2007: Due to a security issue with telnet, it has been disabled.
Please use a SSH client instead of telnet to access mason.gmu.edu.
Visit http://itusupport.gmu.edu/STG/ssh_install.asp for
information on how to get, install, and use Secure Shell and FTP.
mason> ssh zeus.ite.gmu.edu

SCHOOL OF INFORMATION TECHNOLOGY AND ENGINEERING LABORATORIES.
For account information see:
http://labs.ite.gmu.edu/reference/faq_iteaccount.htm#account

astudent@zeus.ite.gmu.edu's password:
Last login: Tue Sep 18 16:27:04 2007 from vpn94.ite.gmu.edu

MOTD:

02/19/07  The system hercules.ite.gmu.edu is availabe once more for those
          requiring a 64 bit environment.
03/28/07  A release 2007a of Matlab has been installed.
04/24/07  To prevent excessive system load on zeus please run long-running
          and computationally intensive jobs on Hercules.

-bash-3.00$ hostname
Zeus
-bash-3.00$ logout
Connection to zeus.ite.gmu.edu closed.
mason> logout
Connection to osf1.gmu.edu closed.
knoppix@1[knoppix]$
            
GUI SSH for Windows (text-based) command session top

Most IT&E Windows users will want to set up the IT&E VPN software with SSH for Windows. We have a walkthrough that combines installation instructions for both pieces of software, but the VPN is not needed (nor used) for PCs that are physically connected to the IT&E network as in IT&E classrooms and labs, and it is not needed for simple text-base command-line work--you can use SSH for Windows to connect to mason and then to zeus like the above linux example.

Download the SSH for Windows from GMU ITU Support.

Here are the SSH Installation and login test parts of the walkthrough.

To connect to mason.gmu.edu with the SSH Client for Microsoft Windows, start SSH and press the space bar (or from the menu bar choose File, Connect).

Host Name: osf1.gmu.edu
Username: <your mason cluster username>

Leave the rest as defaults, e.g. Port 22, <Profile Settings>, and click Connect (or press Enter). See the message from the server:
UNAUTHORIZED ACCESS PROHIBITED
and click OK.

Password: <enter your mason cluster password>

image of SSH for Windows logon dialog box

The server will limit the amount of time for entering the password, so if you see the Disconnected: Server responded with "Connection closed" message, try again.

Once you are connected to the mason cluster, e.g. osf1.gmu.edu or mason.gmu.edu, you can use the unix ssh command to connect to zeus.ite.gmu.edu as described above.

If you are in the IT&E Labs you can connect directly from MS Windows on the lab PC to your IT&E unix account on zeus.ite.gmu.edu.

File transfer/copy top

The scp (secure copy) command allows you to transfer copies of files through a secure channel like ssh. You initiate the connections according to the arrows in the diagrams, but you can perform both put and get operations through the channels. With the command line you can specify wildcard characters '?' and '*' to transfer several files at a time. With the GUI version (in Windows SSH) you can click-select (Ctrl-click or Shift-click) several files to transfer at one time.

When you transfer files, it may be in either direction:

  • put a copy of a local file (from the local machine) onto the remote machine, or
  • get a copy of a remote file to store onto the local machine.

In this case, the term 'local' does not necessarily mean that the local computer is the one where you are sitting right now because you could have connected from one machine to another to another: here 'local' means the computer from where you had started the file transfer command or program, and the 'remote' computer is the one at the other end of that connection.

Transferring a file will overwrite any already-existing file of the same name in the target directory, whether the transferred copy is a newer or older version; so, be sure of which direction the transfer is going and which file you want to keep and which you want to overwrite.

File transfer: Unix/Linux scp top

When you log on one of the IT&E unix or Linux computers, your IT&E home directory is mounted on that machine until you log off. This means that you can access your files directly when you are in the lab using the the unix computers, or when using SSH from the labs. Since you can ssh to get to zeus from home, you can move files around to where you need them, using your mason cluster account as an intermediate point.

The advanced section includes information for accessing the IT&E Virtual private network (VPN) so that you can connect directly from a home/work/other computer to access resources on the IT&E cluster.

After using ssh to log on your IT&E unix account, you may transfer files to/from your mason/mason cluster account using secure copy commands, which open a second, temporary channel. The secure copy command is:

scp -p [source computer:][path]filename [target computer:]path

For example, to transfer a file called myfile.ext from the IT&E cluster (current directory) to your mason/mason cluster home directory, enter:

scp -p myfile.ext mason: .

The dot is necessary to specify the path to your home(current) directory on the other cluster.

To transfer a file in the other direction:

scp -p mason:myfile.ext   .

This time, the dot represents the current directory on the host where the command is initiated, so the file is transferred from the (source) mason cluster to the (target) IT&E cluster.

You may use the standard unix wildcard characters '*' and '?' in the filenames to transfer multiple files named according to a pattern. The command

scp -p mason:myfile.* .

will transfer files myfile.class, myfile.doc, myfile02.txt, myfile.jav, and all other files with name myfile and any extension. Here is an example of an actual file transfer:

  
(on the mason cluster in the myfiles subdirectory of the home directory)
mason.gmu.edu> ls myfile myfile.class myfile.java myfile.txt (at the zeus.ite.gmu.edu prompt) -bash-3.00$ scp -p mason:temp/myfiles/myfile.txt .
(Since scp was started from zeus, zeus is the local machine.)

UNAUTHORIZED ACCESS PROHIBITED

astudent@mason's password:
scp: warning: temp/myfiles/myfile.txt: No such file or directory.

-bash-3.00$ scp -p mason:myfiles/myfile.* . UNAUTHORIZED ACCESS PROHIBITED astudent@mason's password: astudent@mason's password: myfile.class | 24B | 0.0 kB/s | TOC: 00:00:01 | 100% myfile.java | 23B | 0.0 kB/s | TOC: 00:00:01 | 100% myfile.txt | 21B | 0.0 kB/s | TOC: 00:00:01 | 100% -bash-3.00$

Note that this did not transfer the file that had no dot in its name. Going the other way:

-bash-3.00$  scp -p myfile.* mason:myfiles

UNAUTHORIZED ACCESS PROHIBITED

astudent@mason's password: 
myfile.class         |    24B |   0.0 kB/s | TOC: 00:00:01 | 100%
myfile.java          |    23B |   0.0 kB/s | TOC: 00:00:01 | 100%
myfile.txt           |    21B |   0.0 kB/s | TOC: 00:00:01 | 100%
            
File transfer: Windows top

SSH for Windows provides a secure login terminal and a drag-and-drop secure file transfer interface (and other useful features). Start the file transfer window (shown here in front) from the yellow and blue SSH icon (found in the terminal window's toolbar as well as the Start, Programs,... menu.

image of SSH for Windows file transfer

The panel on the left represents the local computer and the right-side panel shows files on the remote machine. File transfer is as simple as drag-and-drop from one side to the other or between any MS Windows file explorer (or desktop) and the right-side panel. You can also right-click the remote files to rename or delete them.

You can use your mason account as a drop-off point to move files between your home computer and your mason account and then between your mason account and your IT&E unix account. Use the unix scp command for the mason-IT&E transfers, or see the following Advanced section) on how to make it even easier.

Advanced--convenience top

Technology is meant to extend one's abilities, and a good example is file transfer: one way is to use mason as a temporary drop-off point, but it is much easier to connect to the IT&E network and cluster through the IT&E virtual private network (VPN).

The IT&E Labs Linux/Unix cluster is on a protected network. To access that network from home or outside the IT&E Labs rooms requires secure connections--we recommend using SSH Secure Shell and the VPN. (SSH with tunneling works still, and in a similar way, but using the VPN is more straightforward.)

diagram: VPN, ssh and tunnel

IT&E Virtual Private Network (VPN) top

If you are using a computer in the IT&E Labs or classrooms, or one that is physically attached to the IT&E network, you can connect directly to other machines networked in the IT&E cluster, e.g. zeus, hercules, ...

If you set up a remote computer or your computer at home with VPN software, then you can also connect directly to other resources in the IT&E cluster, e.g. zeus, hercules, ... Windows users can follow this detailed walkthrough to get, install and use the software. The VPN software and instructions are available for Linux, Mac and Windows in the IT&E Access Manager pages. Be sure to read the webpage certificate security info.

The software establishes a secure channel, so you can log in directly with SSH to the IT&E cluster computers and connect to them directly with other applications, e.g. like web-browsers or a database connector.

(The information on how to configure tunneling with SSH is still available, but is not needed when using the VPN.)

X Window graphics on MS Windows--Cygwin/x top

Unix and Linux typically have Xwindow as their built-in GUI, and the ssh command has an option for using Xclients, e.g. ssh -X username@hostname. There is a port of the X Window System to the Microsoft Windows platforms called Cygwin/X that allows you to display graphical X clients generated by other computers on your Microsoft Windows PC. (Commercial X server software for MS windows, such as X-Win32, is also available.)

(If you also want to add linux-like functionality and run X clients generated from your own Windows PC, you can check out the Cygwin environment. See an installation walkthrough in MS-Word format.)

SSH can be configured to tunnel X11 connections, so it simplifies getting a graphical display from a unix system to your Windows PC. First install the SSH client for Windows and your X server software. Then, start SSH Secure Shell and choose Edit, Settings. In the left pane, find and highlight Profile Settings, Tunneling. In the right pane, in the area at the bottom make sure the box is checked for Tunnel X11 connections. Click OK, File, Save Settings and exit all SSH windows. The setting will be effective the next time the program is started.

Log on to the IT&E VPN and see the icon show as green in the system tray. (You can skip this step if you are not connecting to the IT&E network.)

Start your Xserver. The Xserver must be started and running to receive any Xclient displays sent to your machine. If you are using Cygwin/X on Windows, open a Cygwin bash shell and enter startx &--you should see the 'X' icon appear in the system tray.

Use SSH to connect to your account on the machine you will use.

Be warned that graphics communications takes a lot more data transmission than text. We advise that you consider your telecommunications speed, screen resolution and color depth. Check the response time for simpler Xclients from the remote host, like xterm and xclock, before trying full-blown graphical applications. You may find your application to be anywhere from smooth to unusable depending upon those and other factors.

[picture of x clock]

Some applications have startup options to run without a graphical user interface, for example, you can start Matlab in text mode with 'matlab -nodisplay'. If you need Matlab graphics, use 'matlab -nosplash &' and resize the Matlab command window to a usable small size (with fewer pixels).

Tip: Check to see if the application is available in a version for your operating system. You may find it better to run it on your own machine, and transfer data files to or from the school computers for when you need to work on it there. Graphical applications work fastest on local hardware without extra communications load.

Example: Starting the gimp on chrono (unix, with Xserver running on local Windows PC) took one minute thirty-five seconds, and locally on the 450 MHz PII Windows machine it took 12 seconds--for the same software version. Bandwidth Place shows the storage speed on that computer as 261.6 kB/s at 2:52 AM using 32-bit true color and cable modem (and 385.8 kB/s on a newer 2.4 GHz P4 connected through the same modem). (Half an hour later, a PC at school tests as connecting at 5 Mbps with storage rate as 610.5 kB/s.)

Tips top

  • When connecting to other computers, use multiple SSH or xterm windows. If you are developing code, you may find it easier to open one window for editing and a second window for recompiling, running, and displaying messages. (Open more windows if it helps.)
  • Linux and Unix have multiple desktops built-in. For Windows XP, get the free Virtual Desktop Manager. If you need large areas for applications this may help by allowing you to switch among views. You can also specify certain windows to show on all desktops.
  • Check for tweaks to make your PC faster.
  • contribute tips?

IT&E Instructional Computing Laboratories provide a framework for computing-related educational activities within the School of Information Technology and Engineering. The labs serve students of all the Departments in IT&E.