Instructions for SSH and SCP

To utilize the encrypted remote login, which is often necessary for secure systems, one must use the ssh protocol for access and scp for file transfer. If you would like to find out more about the technical aspects of SSH, see the following. The following instructions should be enough to get you started using a command line interface on a linux/UN*X system.

SSH

To log onto a secure machine (one where telnet, rsh, rlogin, etc. have been disabled), the commands are as follow:

$> ssh <username>@<remotehost>

where <username> is the login name you have on the machine named <remotehost>. The $> denotes where the prompt starts. **DO NOT TYPE $>**. An example is

$> ssh blair@foo.clarku.edu

After typing this command you will be asked to enter your password. After entering your password for that machine< you will be logged in. All traffic between the terminal where you are working and the remote machine will be encrypted.

If you are working in the Computer Simulation Laboratory, you are behind a firewall. As a result, X-forwarding has been disabled, To get around this, you have to give the -X option (upper case X). The command therefore becomes

ssh -X <username>@<remotehost>

SCP

Due to the fact that protocols such as FTP and RCP do not utilize encryption of passwords or data, we must use scp for the transfer of files. This command has the same usage as SSH. To copy a file from where you are working to a remote machine, the command is

$> scp <file> <username>@<remotehost>:{<directory>}

where <directory> is optional. If the directory is not given after the colon, the file will be saved in your home directory

The statement
$> scp foo.java blair@foo.clarku.edu:java
will save the file foo.java to my directory java/ on the machine foo.clarku.edu.

To retrieve a file from a remote machine, the order is reversed:

$> scp blair@foo.clarku.edu:java/foo.java ./java

will bring foo.java from the java directory on foo and save it to the java directory where I am giving the scp command. To save to the home directory the ./<dirname> is just a . /

Man Pages

One of the simplest ways to see this information and information in general on a Linux/Unix system is to utilize the manual pages or man pages for short. If I wanted information on how to use SSH or SCP, I would type:

$> man ssh
or
$> man scp

Give it a try.