skip to primary navigationskip to content
 

SFTP clients: Fetch, FileZilla and Unix

The following SFTP client programs are provided on the Managed Cluster Service (MCS).

WinSCP | Fetch (Mac OS X) | SFTP on Unix

WinSCP

WinSCP is freely available online. To connect to an SFTP site, select 'SFTP' from the file protocol pop-down, then add the hostname e.g. sftp.pwf.cam.ac.uk. The port number will be set to 22.

Add your username and password, then login. You can save settings by clicking the 'Save as' button.

Once you are connected to your remote host, a list of folders and files for the remote system will appear on the right, with your local file hierarchy on the left. You can transfer files by double-clicking on them, or by dragging and dropping between the two filing systems.

To disconnect, select F10, and click 'OK'.

Fetch (Mac OS X)

Double-click on the Fetch program icon and select New Connection from the File menu. Fill in the hostname (such as sftp.pwf.cam.ac.uk), and the appropriate user identifier and password. In the Connect using box you should normally select SFTP. Then click on Connect.

Once you are connected, a list of files will appear in a window. Double-click folders to examine their contents, and drag-and-drop files to move them to or from a folder in your local filespace.

The Remote menu in Fetch allows you to delete files or folders on the remote system, to create folders, and to view a remote file without explicitly fetching it.

On your own Mac, you can store connections you use most often as shortcuts. Select New Shortcut from the Shortcuts menu. Fill in the details (except your password) and click OK. You will then be able to open the connection at any time by selecting it from the Shortcuts menu, or by using the dropdown menu (under the heart symbol) in the New Connection dialog box. Shortcuts can even link to a specific folder or file.

SFTP on Unix

To invoke SFTP on a Unix system, use the command sftp followed by the name of the remote system you wish to contact – for example: sftp sftp.ds.cam.ac.uk. You will then be asked for your password. The program reports that a connection has been made (or gives details if it fails) and then awaits further commands.

Navigating file systems

The commands available vary between systems but the simple ones are common to all. On any system, the help command lists the SFTP commands available. Useful commands for navigating around the remote filing system include:

  • ls, which lists the files in the current working directory
  • dir, which gives a more detailed listing
  • cd name, which changes to the subdirectory name within the current working directory
  • cd .., which changes to the parent directory of the current directory
  • pwd, which displays the name of the current working directory.

Many versions of SFTP provide similar commands for navigating through the directories on your local system (e.g. lcd to change directory on the local system). Others simply provide a command (usually the ! character) that escapes to the local operating system and allows you to issue whatever local commands are needed; exit returns you to the program.

Transferring files

The most useful commands for transferring files are get (remote to local) and put (local to remote). The syntax is get file if the file is to be given the same name on the destination system as it has on the source, or get file1 file2 where file1 is the source name, and file2 the destination name. The syntax for put is similar.

Other useful commands for file transfer (not available in all programs) are mget and mput, which allow multiple transfers – for example, mget data* executes a get command for every file in the current directory whose name begins with data. Files cannot be renamed using mget or mput.

Usually you can interrupt a transfer using ctrl/C.

Various SFTP programs provide some or all of the following:

  • rm deletes a file on the remote system
  • mkdir creates a directory on the remote system
  • rmdir deletes a directory on the remote system.

If you run out of quota while uploading files to a remote system via sftp, you will be told only that the operation has failed, but not the reason. You can check your quota using the ssh command ssh linux.ds.cam.ac.uk quota -v.

The quit command closes the session.