Ceci est une ancienne révision du document !


Copying files

Using scp

From ENS network

  • Copy from your computer to allo-psmn :
scp file1 yourlogin@allo-psmn:~/file2
 
scp path1/file1 yourlogin@allo-psmn:~/path2/file2

You'll need to enter your password except if you you are using an SSH agent.

  • Copy from allo-psmn to your computer
scp yourlogin@allo-psmn:~/file1 file2
 
scp yourlogin@allo-psmn:~/path1/file1 path2/file2

You'll need to enter your password except if you you are using an SSH agent.

From outside of ENS network

  • Copy (file1 → file2) from your computer to allo-psmn (via ssh.psmn):
scp -oProxyCommand="ssh yourlogin@ssh.psmn.ens-lyon.fr netcat -w1 allo-psmn %p" file1 yourlogin@allo-psmn:~/file2
 
scp -oProxyCommand="ssh yourlogin@ssh.psmn.ens-lyon.fr netcat -w1 allo-psmn %p" path1/file1 yourlogin@allo-psmn:~/path2/file2
  • Copy (file1 → file2) from allo-psmn to your computer (via ssh.psmn):
scp -oProxyCommand="ssh yourlogin@ssh.psmn.ens-lyon.fr netcat -w1 allo-psmn %p" yourlogin@allo-psmn:~/file1 file2
 
scp -oProxyCommand="ssh yourlogin@ssh.psmn.ens-lyon.fr netcat -w1 allo-psmn %p" yourlogin@allo-psmn:~/path1/file1 path2/file2

You can use simpler copy commands just by using a config file for SSH multihops. This file is also useful for your everyday connection to the PSMN and if you choose to use sshfs or rsync for transferring/copying files .

Using sftp

From ENS network

First, you need to open a sftp session:

sftp yourlogin@allo-psmn

Output: Connecting to allo-psmn…

Then, enter your password

sftp> pwd

Remote working directory : /home/yourlogin

sftp>

Use the command put and get to transfer files within the sftp session.

From outside of ENS network

Fill in the command below:

sftp -oProxyCommand="ssh yourlogin@ssh.psmn.ens-lyon.fr nc allo-psmn %p" yourlogin@allo-psmn

Using rsync

From ENS network

  • Copy from your computer to /home/yourlogin/targetdir/ at PSMN :

You need a multi-hop SSH configuration (see ~/.ssh/config)

Exemple with the front node m6142comp1:

  • ~/.ssh/config
Host m6142comp1
  User <yourlogin>
  Hostname m6142comp1
  ProxyCommand ssh <yourlogin>@allo-psmn.psmn.ens-lyon.fr netcat -w1 %h %p
  • commande rsync
rsync -avz -4 --ignore-errors --delay-updates -e ssh ./sourcedir <yourlogin>@m6142comp1:~/targetdir/

The name of all available front nodes is listed here.

Check rsync's man for other useful options (dry-run, human-readable, progress …).

From outside of ENS network

# external gateway
Host allo-external
  User <votrelogin>
  ProxyCommand ssh <votrelogin>@ssh.psmn.ens-lyon.fr netcat -w1 allo-psmn %p
 
Host m6142comp1-ext
  User <votrelogin>
  Hostname m6142comp1
  ProxyCommand ssh <votrelogin>@allo-external netcat -w1 %h %p
  • rsync command

from your computer to the front node as defined in the config file: m6142comp1-ext

rsync -avz -4 --ignore-errors --delay-updates -e ssh ./sourcedir <votrelogin>@m6142comp1-ext:~/targetdir/

Using sshfs

You need to use a SSH multi-hop configuration: see documentation.

Example :

~/.ssh/config
 
Host *
  TCPKeepAlive yes
  ForwardAgent yes
  ForwardX11 yes
 
Host allo-psmn-multihop
  User yourloggin
  ProxyCommand ssh -qt yourloggin@ssh.psmn.ens-lyon.fr allo-psmn 22
# verbose (debug):
  #ProxyCommand ssh -v yourloggin@ssh.psmn.ens-lyon.fr allo-psmn 22
 
Host multihop-psmn
  User yourloggin
  Hostname m6142comp1
  ProxyCommand ssh -qt yourloggin@allo-psmn-multihop netcat -w1 %h %p
  • Mount your /home (from PSMN):
ltaulell@xt3:~$ mkdir -p mnt/home-psmn
ltaulell@xt3:~$ sshfs multihop-psmn:/home/ltaulell /home/ltaulell/mnt/home-psmn/

To unmount you /home :fusermount -u ~/mnt/home-psmn/

  • Mount share volume (here, ondesint) :
ltaulell@xt3:~$ mkdir -p mnt/equipe-psmn
ltaulell@xt3:~$ sshfs multihop-psmn:/Xnfs/ondesint /home/ltaulell/mnt/equipe-psmn/

To unmount : fusermount -u ~/mnt/equipe-psmn/

From a Windows machine

From a Windows© machine, use the following combinaition of tools PuTTY / WinSCP.

en/documentation/tutorials/copie.1591689015.txt.gz · Dernière modification : 2020/08/25 15:58 (modification externe)