Accessing your files remotely using Secure Copy (SCP) / Secure FTP (SFTP)

All departmental Linux machines running a standard CSG build are running OpenSSH servers which, in addition to allowing users to obtain remote shell sessions, also allow secure access to local and network filesystems via the `scp` (Secure Copy) protocol. (scp is similar to and supercedes the rcp Remote Copy program.

In addition, Linux servers in DoC support Secure FTP (SFTP) protocols, which supersede the old FTP protocol.

Access to some hosts is restricted to specific groups of users, in general please check whether the host you want to use allows you to ssh into it first before trying scp/sftp with it. Also, note that attempting to use SSH, SFTP or other similar services with doc.ic.ac.uk (without any host specified) will not work.

From the Unix command-line

If you have a Unix command-line available to you -- e.g. you're using a Linux terminal, or are running some variant of Mac OS X -- then you should have the standard OpenSSH tools available to you.

Some example incantations:

  • Connect as jbloggs on shell1.doc.ic.ac.uk, and copy a file to your local machine:

    • scp jbloggs@shell1.doc.ic.ac.uk:file/in/home/directory local/path/here

  • Connect as jbloggs on shell1.doc.ic.ac.uk, and upload a local file to /tmp on that host:

    • scp local/file/here jbloggs@shell1.doc.ic.ac.uk:/tmp/

Please note: scp will not warn you if a destination file already exists: if there is a clash, the destination file will be over-written. There are several useful options for scp: '-C' enables compression, '-r' allows one to recursively copy directories and '-c' is used to specify the underlying encryption cipher. These options can be combined - for example:

scp -Cr -c blowfish-cbc ~/LargeTextFileResultsFolder jbloggs@shell1.doc.ic.ac.uk:Documents

You can also use 'glob' patterns ('*' and '?') with scp but these characters may need to be escaped (that is, preceded with '') in order to avoid being expanded or misinterpreted by both the local and remote shell.

Please see the scp and sftp manual pages for further details (e.g. man scp).

You may find cyberduck to be a useful scp GUI under OS X.

 

From a GNOME desktop

The Nautilus file-browser allows you to connect to remote SFTP services. From the Places menu on the desktop, select Connect to Server.... In the dialog that appears, select the following options:

  • Service type: SSH
  • Server: sftp.doc.ic.ac.uk

Under "Optional information", you should also set:

  • User Name: (put your username here, e.g. jbloggs)

On your first connection, you will likely be prompted to verify the identify of the remote computer. You can verify the authenticity of a provided fingerprint by checking it against our central list of SSH server fingerprints.

From a Windows client

Windows clients do not, as standard, ship with the ability to interact with SSH services. You will most likely need to install some third-party application. The following tools are frequently used: