Using SSH and SCP

Secure Shell (SSH) is a way of communicating between computers through an encrypted channel. When you SSH to another computer, you can execute commands on the remote computer from your own computer. Typically, you might use SSH to connect your personal computer with a lab computer to work or to transfer files.

Connecting using SSH

You can use any terminal program (Terminal on Macs, Cygwin or others on Windows) to establish an SSH connection. To connect via SSH:

You may now execute commands on the remote computer as if you were physically logged in on it. For example, you use SCP to transfer your programs (see below) and then issue compilation and run commands from an SSH session:

To log out from your SSH session, type logout in the SSH terminal.

See the Remote Access page for more information about remote access.

File transfer using SCP

Secure Copy (SCP) is method of transferring files between computers over a secure channel. It uses the SSH protocol to do so. SCP works just like the Linux cp command except one of the operands refers to a remote location. Note that you do not have to establish your own SSH connection first.

The remote location must be specified using a special format:

The <remote-username>@ part may be omitted if the username on the remote computer is the same as your current username on your computer.

For example, to copy over a file from your homework folder to your home directory on the CS machines, you might issue an SCP command as follows:

This command will move all files from your local homework directory to ~/private/homework on the CS file system. It is safest for the destination folder to exist before the command is issued.