Prepared for IRLS 588 by Trevor Smith
Last updated 2/9/2004



Using scp (Secure Copy) To Transfer Files


Secure Copy

Secure copy (scp) is a file transfer protocol that is used in conjunction with Secure Shell (ssh) to provide a safe way of moving files over the network between computers.  The protocol replaces insecure methods of copying files such as ftp (file transfer protocol) in which passwords and files are transmitted via clear text.  Most installations of ssh include the software necessary to use scp.

A common use for scp is to create a document (or web page) on your local computer and transfer that file to a Unix server for display, backup or printing.

At the University of Arizona you must use scp if you wish to transfer files to your u.arizona.edu account.

Whenever you copy files between computers the permissions on those files can be altered.  If you have any trouble accessing newly copied files, check the permissions.



Instructions for Macintosh OS X and Linux

The scp command is installed as part of the ssh package and should exist by default on OS X and nearly every Linux distribution.  To use it on your local machine, open a terminal window (terminal in OS X or an xterm in Linux).  At the prompt, change to the appropriate directory and run the command.

$ cd Desktop
$ pwd
/Users/trevors/Desktop

Once in the appropriate directory, copy the file to a specific directory at u.arizona.edu

$ scp MyGreatWebPage.html username@u.arizona.edu:public_html

You will be prompted for your password and the progress of the copy will be displayed.

The general form of the command is:

scp <source file> <destination file>
where either file can be local or remote.  If it is remote, it must be preceded with username@server:

So, to copy a file from the server to your local machine:

scp username@remote.server.edu:myfile myfile

to copy a file from your local machine to the server:

scp myfile username@remote.server.edu:myfile



Instructions for Windows

Java Client

If you are using the Java client, the scp software is built in to the applet.

Log in, go to the File menu and SCP File Transfer:

Java File Menu


On the SCP File Transfer screen, use the "ChgDir" buttons to change the directories (local computer on the left, remote computer on the right).  Select the files that you wish to move with the mouse and click on the arrows in the middle to start the transfer.  You may copy either direction with this client.

Java SCP Screen




SSH Client

If you are using the dedicated ssh client for windows, log in and open the "New File Transfer Window":

SSH Client



On the "New File Transfer Window" select the directory on the server in which you wish to put the files from your local computer.  Then click the "Upload" button:

New File Transfer Window


Finally, on the Upload screen, select the files you wish to copy and click the "Upload" button:

Upload Screen