Difference between revisions of "Introduction to Linux in HPC/SSH Graphics File Transfer"

From HPC Wiki
Introduction to Linux in HPC/SSH Graphics File Transfer
Jump to navigation Jump to search
m (Remove unwanted initial line breaks)
m
Line 3: Line 3:
 
{{Syllabus Introduction to Linux}}<nowiki />
 
{{Syllabus Introduction to Linux}}<nowiki />
 
__TOC__
 
__TOC__
 +
 +
This tutorial explains how to view a graphical program that runs on a remote computer, e.g. an HPC cluster, on your local computer with X-forwarding. It also describes how to copy files between your local computer and a remote computer as well as copying files between two remote computers with SCP.
  
 
=== Video === <!--T:5-->
 
=== Video === <!--T:5-->
Line 12: Line 14:
 
=== Quiz === <!--T:5-->   
 
=== Quiz === <!--T:5-->   
  
{{Note|'''Exercises in Terminal: no exercises in this section'''}}
+
{{hidden begin
 +
|title = Which operating system do you need on your local computer to forward your graphical programs from a Linux cluster to it via ssh-X-forwarding?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
-  This only works if your local computer runs Linux.
 +
||
 +
+  This works if your local computer runs Windows, Mac OS, or Linux.
 +
|| Explanation: For Mac OS you can use XQuartz and for Windows either xming or MobaXterm.
 +
-  It works on any operating system out of the box.
 +
|| 
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = Is X-Forwarding with <code>-X</code> or with <code>-X -Y</code> more secure?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  Only using <code>-X</code> instead of <code>-X -Y</code> is more secure.
 +
|| Explanation: The argument <code>-Y</code> DISABLES some security measures because it assumes a trusted environment.
 +
-  Using <code>-X -Y</code> instead of <code>-Y</code> is more secure.
 +
||
 +
-  There is no difference.
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = Can you access files on your local computer in a program that was started via X-forwarding on a different computer?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+ No.
 +
|| Explanation: Even though the window is displayed on your local computer, the program runs on the remote computer. Thus, without any additional tools, you can only access the files on the remote computer.
 +
-  Yes.
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = Who can you copy a directory <code>mydir</code> on your local computer via scp to the home directory of the user <code>username</code> on the remote computer <code>remotehost</code>?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
-  <code>scp mydir username@remotehost
 +
||
 +
-  <code>scp mydir username@remotehost:~
 +
||
 +
+  <code>scp -r mydir username@remotehost:~
 +
|| Explanation: <code>-r</code> is required to be able to copy directories recursively. The target is specified as <code>username@remotehost:~</code>, where <code>~</code> is an abbreviation for the home directory of the user <code>username</code> on the remote computer.
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = Are there graphical variants that you can use instead of <code>scp</code>?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
-  No.
 +
||
 +
+  Yes.
 +
|| Explanation: Examples are WinSCP, MobaXterm,...
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{Note|'''no exercises in this section'''}}
  
 
{{Tutorial Navigation
 
{{Tutorial Navigation

Revision as of 16:51, 22 November 2020

Tutorial
Title: Introduction to Linux in HPC
Provider: HPC.NRW

Contact: tutorials@hpc.nrw
Type: Multi-part video
Topic Area: HPC Platforms
License: CC-BY-SA
Syllabus

1. Background and History
2. The Command Line
3. Linux Directory Structure
4. Files
5. Text display and search
6. Users and permissions
7. Processes
8. The vim text editor
9. Shell scripting
10. Environment variables
11. System configuration
12. SSH Connections
13. SSH: Graphics and File Transfer
14. Various tips

This tutorial explains how to view a graphical program that runs on a remote computer, e.g. an HPC cluster, on your local computer with X-forwarding. It also describes how to copy files between your local computer and a remote computer as well as copying files between two remote computers with SCP.

Video

( Slides as pdf)

Quiz

Which operating system do you need on your local computer to forward your graphical programs from a Linux cluster to it via ssh-X-forwarding?

This only works if your local computer runs Linux.
This works if your local computer runs Windows, Mac OS, or Linux.
It works on any operating system out of the box.

Is X-Forwarding with -X or with -X -Y more secure?

Only using -X instead of -X -Y is more secure.
Using -X -Y instead of -Y is more secure.
There is no difference.

Can you access files on your local computer in a program that was started via X-forwarding on a different computer?

No.
Yes.

Who can you copy a directory mydir on your local computer via scp to the home directory of the user username on the remote computer remotehost?

scp mydir username@remotehost
scp mydir username@remotehost:~
scp -r mydir username@remotehost:~

Are there graphical variants that you can use instead of scp?

No.
Yes.

Note: no exercises in this section


<< SSH Connections

Overview

Various Tips >>