All users have the option to transfer files to and from the systems. Instructions on how to do that can be found below.
The two most common commands you can use for data transfers over SSH:
scp or secure copy is probably the easiest of all the methods. The basic syntax is as follows:
$scp [-r] source_path destination_path
where the -r option copies the directories recursively.
Transfer from your local machine to the remote cluster home directory
Let’s assume you have a local directory ~/code/myfiles
you want to transfer to the cluster, in your remote home directory:
$scp -r ~/code/myfiles username@hostname:
To transfer the local directory ~/code/myfiles
to the directory ~/project
:
$scp -r ~/code/myfiles username@hostname:project/.
Transfer from the remote cluster to your local machine
Let’s assume you want to transfer back the directory ~/project/code/myfiles
to your local machine:
$scp -r username@hostname:project/code/myfiles /path/to/local/directory
See the scp(1) man page for more details.
An alternative to scp is rsync, which has the advantage of transferring only the files which differ between the source and the destination. This feature is often referred to as fast incremental file transfer. The typical syntax of rsync is similar to the one of scp:
$rsync -rv source_path destination_path
where the -v option enables the verbose mode and the -r option copies the directories recursively.
Transfer from your local machine to the remote cluster home directory
Coming back to the previous examples, let’s assume you have a local directory ~/code/myfiles
you want to transfer to the cluster, in your remote home directory:
$rsync -rv ~/code/myfiles username@hostname:
To transfer the local directory ~/code/myfiles
to the directory ~/project
:
$rsync -rv ~/code/myfiles username@hostname:project/.
Transfer from the remote cluster to your local machine
Let’s assume you want to transfer back the directory ~/project/code/myfiles
to your local machine:
$rsync -rv username@hostname:project/code/myfiles /path/to/local/directory
See the rsync(1) man page for more details.
WinSCP is a popular Secure File Transfer application (SFTP) for Windows computers which also includes support for SCP file transfers, and the ability to create secure tunnels via SSH.
The software can be downloaded here.
The installation of WinSCP is quite simple. Basically you need to click on the Next button several times leaving the default options.
In order to customize it to your likings you can choose between the Norton-Commander interface and the Windows Explorer-like interface. The main difference is that the first interface provides 2 panels (one with the local computer directory structure and the other with the remote) while the second shows only the remote.
Once you are ready with the installation, you can establish a secure connection from your local computer to the remote server as seen below. You just need to give the hostname of the cluster, your username and browse to find your private key:
During the establishment of the connection you will be prompted for the pass phrase of your key.
Transfer from your local machine to the remote cluster
Transfer from the remote cluster to your local machine