Actions

Difference between revisions of "File transfer"

From ALICE Documentation

(File transfer from and to Windows Machine)
(File transfer from and to Mac)
Line 103: Line 103:
 
<br />
 
<br />
 
==File transfer from and to Mac==
 
==File transfer from and to Mac==
 +
For the Mac you use scp to transfer files between your personal machine and ALICE. This is identical to Linux file transfer as described above.

Revision as of 11:25, 9 July 2019

File transfer from and to Linux

Before you can transfer files you need access to the login nodes of ALICE. For details on setting up ssh logins see Login to cluster. Once you hae successfully setup the ssh configurations you can use two different methods to transfer data: scp and sftp.

scp file transfer

You need to know to which file systems on ALICE you can and want to copy your files. See the File systems section for detail on which directory structures are available to you. Once you know where to/from you want to copy data use the unix scp command to perform the copy operation. Note: you have successfully setup key based authentication and made a ssh configuration host name hpc1:

 scp <local_file_name> hpc1:/data/<username>/

where you have previously created a directory on the /data file system

 mkdir /data/<username>

where <username> is your account name. This copies a local file to ALICE. To copy a file on an ALICE file system back to your local desktop or storage medium use:

 scp hpc1:/data<username>/<remote-file-name> .

where the . is representing the current directory. For more details on how to use scp te:

 man scp

sftp file transfer

Data can also be transfered using the sftp copy program. Again we presume you have successfully configured the ssh login with key based authentication. In thath case you can simply type in:

 $ sftp hpc1:
 #############################################################
 
                Welkom bij de SSH Gateway van de
                      Universiteit Leiden
 
        Deze gateway dient slechts als SSH toegang tot
        achterliggende systemen. Oneigenlijk gebruik van 
        deze server kan leiden tot het ontzeggen van toegang.
            
                Welcome to the SSH Gateway of the 
                    University of Leiden
        The only purpose of this gateway is SSH access to other
        systems. Improper use can lead to denial of access.
 
                              N.B.
         Public Key authentication and more is possible,
         see for this SSH-README.txt
         Use screen at the destination.
 
         Voor vragen/For questions: issc.leidenuniv.nl
 #############################################################
 Connected to hpc1.
 Changing to: /home/deuler/.
 sftp>

We can then use various commands to traverse and manipulate both file systems. A list of commands are listed below:

Command Function Example
cd Changes the directory of the remote computer cd remote_directory
lcd Changes the directory of the local computer lcd local_directory
ls Lists the contents of the remote directory ls
lls Lists the contents of the local directory lls
pwd Prints working directory of the remote computer pwd
lpwd Prints working directory of the local computer lpwd
get Copies a file from the remote directory to the local directory get remote_file
put Copies a file from the local directory to the remote directory put local_file
exit Closes the connection to the remote computer and exits the program exit
help Displays application information on using commands help

File transfer from and to Windows Machine

To transfer files between your desktop and the ALICE files systems you first need to setup your ssh configurations to allow key base login to the sshgw machine, including the ssh login tunnels as described in Login to cluster. After this you can startup WinSCP and configure a session to ALICE login node 1:

Winscp1.png

Select the 'New Site' and specify as Host Name: localhost and as Port number: 2222 (which are the settings for the tunnel you have running, since you hve started putty with the ALICE_GW config). You can now setup the key based authentication by clicking the Advanced button. In the new window select SSH and then Authentication. In the Private key file box you browse to the private key file you have previously creates (see Login to cluster for details). You may choose from the File protocol drop down menu either SCP of SFTP. It does not matter for the main window of WinSCP which protocol is used.

Winscp4.png

Once all of this has been doen, save this configuration into a session config by clicking Ok and then clicking Save. Give this configuration a useful name, e.g. ALICE login1, and click Ok.

Winscp2.png

After this you can now click the Login button. On first access you may be presented a confirmation window for key exchange. Click Ok.

Winscp3.png

Now you will be presented the WinSCP main window in which on the left you have the local file system and on the right you see the remote file system on ALICE login node 1, your home directory.

Winscp5.png

Now you can transfer files to and from ALICE.

File transfer from and to Mac

For the Mac you use scp to transfer files between your personal machine and ALICE. This is identical to Linux file transfer as described above.