Secure File Transfer Protocol (sftp)
How to transfer files using the SFTP command line tool
The sftp command provides an interactive file transfer client, although it can be used in a one-off transfer manner to get individual files. Whilst it is more complex to use than scp, it may be more efficient when you have many files to transfer that can't be specified (easily) with wildcards, especially when you are connecting to a system using multi-factor authentication (such as BMRC's cluster).
In addition, some services only support SFTP connections, such as the WIN MRI download system when used with SFTP Only accounts.
The basic sftp command syntax is
sftp destination
where destination is of the form user@host:path. As with scp, user@ is optional if the username is the same on your computer as the remote service and if path is not specified then it will use your remotely configured home folder.
When you have authenticated you will get a prompt that can be used to move around the remote file system; use 'cd' and 'ls' as you would on a UNIX system to change directory and list the contents. You can also interact with your local file system with the 'lcd' and 'lls' equivalents.
To upload files/folders use 'put' and to download use 'get' with the filename of the local or remote object respectively.
If you will be copying large volumes of files then you make be able to improve performance by requesting the use of a hardware accelerated encryption mode, do this with:
-c aes128-gcm@openssh.com
To make this the default for a particular host you can put this in your local .ssh/config file:
Host sftp.fmrib.ox.ac.uk Ciphers aes128-gcm@openssh.com
N.B. If your data use agreement/DPIA stipulates that data transfers must be encrypted to AES256 standard then switch this out for aes256-gcm@openssh.com - this is somewhat slower.