SSH, SCP, and SFTP
SSH is a process for contacting a remote UNIX computer and accessing its command line to issue commands to it. SCP is a related process for accessing a remote UNIX computer and uploading or downloading files to/from it. SFTP is similar to SCP. You may find these processes to be very convenient for working remotely on your computer projects.
IT&E maintains a web page for obtaining and using SSH, SCP, and SFTP, though we think you may like the instructions below.
Obtaining SSH and SCP (or SFTP) Software
Windows Users: Download an SSH/SFTP program here.
Mac and Linux Users: The instructions below are for Windows users, but should be enough for you to get the gist. Macs and Linux machines don't have a GUI SSH: instead they have SSH and SCP built-in on the command line, and the programs work similarly to the SSH and SCP command line programs on MASON and zeus. For example, on the Mac you can log into a MASON by launching the Terminal application (at /Applications/Terminal.app) and doing:
- Type
ssh mason.gmu.eduand press RETURN. - You may be prompted about key generation. Type yes and press RETURN in this case.
- Type in your MASON password as prompted and press RETURN.
- You can log out by closing the window or typing
exit
You can use scp in a similar fashion as the examples below as well. But if you'd like a graphical interface for scp, like the one on Windows, there is a nice free one for OS X called Fugu.
MASON vs. Zeus
MASON is a cluster machine run by ITU. You can access it from anywhere on the internet. Zeus is a machine run by IT&E and shares its hard drive with your IT&E unix lab account machines. Below we'll discuss how to log into each of these machines, upload files, and download files.
OSF1/MASON
mason.gmu.edu (otherwise known as osf1.gmu.edu) is a computer cluster run by ITU (GMU's information support services). It has fairly old and poor Unix facilities and will be upgraded soon. You can SSH to log into it and SCP to it. MASON is visible from everywhere.
Below we discuss three topics:
- Logging into MASON
- Copying files from your Laptop to MASON
- Copying files to your Laptop from MASON
Logging Into MASON from your Laptop
- Click on the 'SSH Secure Shell Client program, and click on "Quick Connect"
- Put
mason.gmu.eduin the host name, and your user name (on mason) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your mason password when prompted and press RETURN.
- Now you are logged into MASON. Do not use the javac or java programs on MASON. They are very old and will not work properly.
Logging out of MASON
- Type
exitand press RETURN. Or just close the window.
Copying files from your Laptop to MASON
- Download the ssh/scp program (Windows users can get it here) if you haven't done so already.
- Click on the program called SSH Secure File Transfer
- Click on Quick Connect
- Put
mason.gmu.eduin the host name, and your user name (on mason) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your mason password when prompted and press RETURN.
- On the right-hand side you will now see a list displaying your MASON home directory.
- Let's say the file you want to copy if called
Yo.java. Drag theYo.javafile into the MASON home directory list.
Copying files from MASON to your Laptop
- Download the ssh/scp program (Windows users can get it here) if you haven't done so already.
- Click on the program called SSH Secure File Transfer
- Click on Quick Connect
- Put
mason.gmu.eduin the host name, and your user name (on mason) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your mason password when prompted and press RETURN.
- On the right-hand side you will now see a list displaying your MASON home directory.
- Drag the
Yo.javafile out of the MASON home directory list and onto your desktop.
Zeus
Zeus is a computer which shares its hard drive with the computers in the IT&E Unix labs. Your home directory on Zeus is the same as your home directory on those lab computers. On campus (from the Johnson Center, say) you can directly log into Zeus and get files from it using your laptop. But if you're off campus (at home or work, say) you can't see Zeus from your laptop or personal computer. However, you can see the MASON cluster, which we will use as an intermediary step.
Below we discuss six topics:
- Logging into Zeus from OFF Campus
- Copying files to your Laptop OFF Campus
- Copying files from your Laptop OFF Campus
- Logging into Zeus from ON Campus
- Copying files to your Laptop ON Campus
- Copying files from your Laptop ON Campus
Logging Into Zeus from your Laptop OFF campus
- Log into MASON using the instructions in the MASON section earlier in the MASON section.
- Now we'll log into zeus. In the MASON terminal window, type
ssh zeus.ite.gmu.eduand press RETURN. Note: your username on zeus ought to the same as the one on the GMU cluster (and MASON). If it is not, contact the IT&E support staff and have that fixed. - You may be prompted about key generation. Type yes and press RETURN in this case.
- Type in your zeus password as prompted and press RETURN.
- Now you're logged into zeus! You should be able to use ls, cp, javac, etc. on zeus.
For example, Prof. Foo can log into zeus from MASON like this:
mason.gmu.edu> 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
foo's password: I type my password here...
Authentication successful.
Last login: Sat Feb 4 18:07:19 2006 from mason.gmu.edu
----- Thursday November 10th 2005
Due to increasing load, autologout has been initiated after 30 minutes of inactivity.
-----
-bash-3.00$ And I'm logged on!
Logging out of Zeus
- To log out of zeus, type
exitand press RETURN. This will put you back into MASON's command line. - At this point you can log back into zeus if you want. Or to log out of MASON, type
exitand press RETURN. - Or you could have just closed the window to get rid of everything.
Copying files from your Laptop OFF campus to Zeus
To do this we'll first transfer the file to MASON, then use a command called scp on MASON to copy the file to zeus. If you type scp Yo.java zeus.ite.gmu.edu: (the colon at the end is important), you will copy the file Yo.java from MASON to zeus.
Step 1: Copy the file to MASON and the log into MASON from your Laptop
- Copy the file from your laptop to your account on MASON as described earlier in the MASON section.
- Click on the 'SSH Secure Shell Client program, and click on "Quick Connect"
- Put
osf1.gmu.eduin the host name, and your user name (on osf1) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your osf1 password when prompted and press RETURN.
- Now you are logged into OSF1. Do not use the javac or java programs on OSF1. They are very old and will not work properly.
Step 2: Copy the file to from MASON to zeus
- Type
scp Yo.java zeus.ite.gmu.edu:(or replaceYo.javawith whatever file you wish to copy). Remember that the colon is important. Press RETURN. - You may be prompted about key generation. Type yes and press RETURN in this case.
- Type your zeus password when prompted and press RETURN.
- If successful, you'll see something like this:
mason.gmu.edu> scp Yo.java 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
foo@zeus.ite.gmu.edu's password:
Yo.java | 149B | 0.1 kB/s | TOC: 00:00:01 | 100%
And we're done! Log out of MASON by closing the window or typing exit and pressing RETURN.
Copying files from Zeus to your Laptop OFF campus
The way we'll do this is to copy the file from zeus to MASON, and then copy it from MASON to your Laptop.
Step 1: Log into MASON and copy the file from Zeus to MASON
Let's say the file we want to grab from Zeus is stored in your home directory on Zeus and is called Yo.java
To do this we'll again use the command scp, but this type, we're telling it to copy the file from zeus to MASON. Let's say the remote file is called Yo.java on Zeus. We do this by typing the following: scp zeus.ite.gmu.edu:Yo.java . (the space and dot are crucial).
- Log into MASON as described earlier in the MASON section.
- Type
scp zeus.ite.gmu.edu:Yo.java .(or replaceYo.javawith whatever file you wish to copy from your home directory on Zeus). Remember that the space and dot at the end are important. Press RETURN. - You may be prompted about key generation. Type yes and press RETURN in this case.
- Type your zeus password when prompted and press RETURN.
- If successful, you'll see something like this:
mason.gmu.edu> scp zeus.ite.gmu.edu:Yo.java .
SCHOOL OF INFORMATION TECHNOLOGY AND ENGINEERING LABORATORIES.
For account information see:
http://labs.ite.gmu.edu/reference/faq_iteaccount.htm#account
foo@zeus.ite.gmu.edu's password:
Yo.java | 149B | 0.1 kB/s | TOC: 00:00:01 | 100%
You can now close the window or type exit to leave MASON.
Step 2: Copy the file from MASON to your Laptop
- Follow the instructions for copying the file as described earlier in the MASON section.
Logging Into Zeus from your Laptop ON campus
- Download the ssh/scp program (Windows users can get it here) if you haven't done so already.
- Click on the 'SSH Secure Shell Client program, and click on "Quick Connect"
- Put
zeus.ite.gmu.eduin the host name, and your user name (on zeus) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your zeus password when prompted and press RETURN.
- Now you are logged into zeus.
Copying Files from Your Laptop ON campus to Zeus
- Click on the program called SSH Secure File Transfer
- Click on Quick Connect
- Put
zeus.ite.gmu.eduin the host name, and your user name (on zeus) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your zeus password when prompted and press RETURN.
- On the right-hand side you will now see a list displaying your Zeus home directory.
- Let's say the file you want to copy if called
Yo.java. Drag theYo.javafile into the Zeus home directory list.
Copying Files from Zeus to your Laptop ON campus
- Click on the program called SSH Secure File Transfer
- Click on Quick Connect
- Put
zeus.ite.gmu.eduin the host name, and your user name (on zeus) in the user-name, and press Connect. - You may be prompted about key generation. Press the okay button in this case.
- Type your zeus password when prompted and press RETURN.
- On the right-hand side you will now see a list displaying your Zeus home directory.
- Drag the
Yo.javafile out of the Zeus home directory list and onto your desktop.