User/SSH new: Difference between revisions

From Grid5000
Jump to navigation Jump to search
(Replaced content with "== More advanced SSH usage, handling files == === Basic files copy=== Grid'5000 users have home directories in every Grid'5000 sites. But each site home directory is accessible in the access machines in a directory named after the site name. To copy <code class="file">myfile</code> from my workstation to my nancy home: {{Term|location=workstation|cmd=<code class="command">scp -J <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code> </code> <...")
Tags: Replaced Reverted
(Undo revision 109377 by Hdominois (talk))
Tags: Undo Reverted
Line 4: Line 4:


To copy <code class="file">myfile</code> from my workstation to my nancy home:
To copy <code class="file">myfile</code> from my workstation to my nancy home:
{{Term|location=workstation|cmd=<code class="command">scp -J <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code> </code> <code class="file">myfile</code> <code class="replace">jdoe</code>@<code class="host">nancy:</code>}}
{{Term|location=workstation|cmd=<code class="command">scp</code> <code class="file">myfile</code> <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code>:nancy}}


To copy <code class="file">myremotefile</code> from my lyon home to my workstation:
To copy <code class="file">myremotefile</code> from my lyon home to my workstation:
{{Term|location=workstation|cmd=<code class="command">scp -J <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code> </code> <code class="replace">jdoe</code>@<code class="host">lyon</code>:<code class="file">myremotefile</code> <code class="file">/tmp</code>}}
{{Term|location=workstation|cmd=<code class="command">scp</code> <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code>:<code class="file">lyon/myremotefile</code> <code class="file">/tmp</code>}}


To copy <code class="file">mydir</code> from my workstation to my nancy home:
To copy <code class="file">mydir</code> from my workstation to my nancy home:
{{Term|location=workstation|cmd=<code class="command">scp -J <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code> </code> -r <code class="file">mydir</code> <code class="replace">jdoe</code>@<code class="host">nancy:</code>}}
{{Term|location=workstation|cmd=<code class="command">scp</code> -r <code class="file">mydir</code> <code class="replace">jdoe</code>@<code class="host">access.grid5000.fr</code>:nancy}}


===rsync files copy/synchronisation===
===rsync files copy/synchronisation===

Revision as of 10:38, 28 September 2026

More advanced SSH usage, handling files

Basic files copy

Grid'5000 users have home directories in every Grid'5000 sites. But each site home directory is accessible in the access machines in a directory named after the site name.

To copy myfile from my workstation to my nancy home:

Terminal.png workstation:
scp myfile jdoe@access.grid5000.fr:nancy

To copy myremotefile from my lyon home to my workstation:

Terminal.png workstation:
scp jdoe@access.grid5000.fr:lyon/myremotefile /tmp

To copy mydir from my workstation to my nancy home:

Terminal.png workstation:
scp -r mydir jdoe@access.grid5000.fr:nancy

rsync files copy/synchronisation

Copying mydir to my rennes home with rsync through SSH:

Terminal.png workstation:
rsync -avz -e 'ssh -J jdoe@access.grid5000.fr' mydir jdoe@rennes:

tar/ssh files copy

Copying mydir to my rennes home with tar through SSH:

Terminal.png workstation:
tar c mydir | ssh jdoe@access.grid5000.fr tar x -C rennes/mydir

Mounting remote filesystem (sshfs)

To mount a remote filesystem using sshfs:

Terminal.png workstation:
mkdir ~/remote_dir
Terminal.png workstation:
sshfs -o idmap=user -o transform_symlinks jdoe@lyon.g5k:/home/jdoe/ ~/remote_dir

To unmount the remote filesystem :

Terminal.png workstation:
fusermount -u ~/remote_dir