Difference between revisions of "SSH"

From HPC Wiki
Jump to navigation Jump to search
(30 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
[[Category:Basics]]
 
== General ==
 
== General ==
ssh is a program for logging into a remote machine and for executing commands on a remote machine from a Linux or MAC system.
+
Secure Shell (ssh) is a [[shell|commandline]]-tool for logging into a different computer over some network (e.g. the internet) and for executing commands on that machine, as if one would be sitting there instead of the own computer. So you use ssh to build a connection to the other computer and can then interact with it, using it's [[shell]]. It is commonly used to [[Getting_Started#Login_or_.22How-to-now-actually-connect-to-the-supercomputer.22|login]] to the [[Nodes#Login|login nodes]] of a supercomputer.
 +
 
 +
 
 +
__TOC__
  
  
 
== Access ==
 
== Access ==
OpenSSH is the standard ssh client on Linux and MAC and it is freely available for everyone.
+
OpenSSH is the standard ssh client on ''Linux'' and the ''Mac'' and it is freely available for everyone. <br />
 +
On ''Windows'', you can use Putty, Bitvise or the GitBash (coming with ssh) which is also free. On Windows 10 since Update 1709, Microsoft has packaged "ssh" right into windows. You can thus open a '''cmd''' window (Start - type "cmd" - <ENTER>) and run <code>ssh username@hostname.domain</code> like you would with Linux or MacOS.
  
 +
Sometimes access to a cluster's login nodes is restricted to certain networks within the university/facility, so you can connect while being on the campus, but not from your network at home or at other institutions. To nevertheless access those login nodes from external, one can 'pretend to be inside the network' by using a [[VPN|Virtual Private Network (VPN)]] provided by the university operating the cluster.
  
== Manuel ==
+
== Usage ==
Text more remote access to an HPC system is typically available over the encrypted secure shell protocol.
 
 
Logging in with OpenSSH on a Linux Cluster is done with:
 
Logging in with OpenSSH on a Linux Cluster is done with:
  
  $ ssh -l <login> <cluster>
+
<hpc name="loginNode">
 +
<code>
 +
  $ ssh -l login@cluster
 +
</code>
 +
</hpc>
  
Here login is your user name and cluster is one of the frontend nodes of the system.
+
Here <code><login></code> is your username and <code><cluster></code> is one of the [[Nodes#Login|login nodes]] of the system, you are trying to connect to. At the first login you will be asked to verify the authenticity of the host. If the shown host is correct, enter <code>yes</code>. After pressing <code>RETURN</code> you will be prompted to enter your password for the provided username.
A list of frontend nodes is provided as part of the side specific information.
 
  
 
If you need to start graphical applications you need to enable X11 forwarding/X11 tunneling by your ssh client.  
 
If you need to start graphical applications you need to enable X11 forwarding/X11 tunneling by your ssh client.  
For OpenSSH this is done by giving it the "-X" command line option:
+
For OpenSSH this is done by giving it the command line option <code>-X</code> (or <code>-Y</code> if the previous did not work):
 +
 
 +
<hpc name="loginNodeX">
 +
<code>
 +
$ ssh -X -l login@cluster
 +
</code>
 +
</hpc>
 +
 
 +
This might or might not work depending on the your operating system, because it requires an [https://en.wikipedia.org/wiki/X_Window_System X11-Server] running on your local machine, which is not available by default on Mac and Windows. To utilize graphical tools anyway, you might want to look into [https://doc.itc.rwth-aachen.de/display/CC/Remote+desktop+sessions FastX], which provides the necessary functionality for Mac and Windows.
  
$ ssh -X -l <login> <cluster>
+
For more security and ease of use you should consider setting up authentication via [[ssh_keys|ssh keys]].
  
 
== FAQs ==
 
== FAQs ==
 +
[https://wickie.hlrs.de/platforms/index.php/Secure_Shell_ssh slightly longer description]
 +
 
[https://www.freebsd.org/cgi/man.cgi?query=ssh&sektion=1 ssh manpage]
 
[https://www.freebsd.org/cgi/man.cgi?query=ssh&sektion=1 ssh manpage]
 
== Side specific information ==
 
[https://doc.itc.rwth-aachen.de/display/CC/Access RWTH Aachen frontend nodes]
 

Revision as of 13:19, 23 June 2020

General

Secure Shell (ssh) is a commandline-tool for logging into a different computer over some network (e.g. the internet) and for executing commands on that machine, as if one would be sitting there instead of the own computer. So you use ssh to build a connection to the other computer and can then interact with it, using it's shell. It is commonly used to login to the login nodes of a supercomputer.



Access

OpenSSH is the standard ssh client on Linux and the Mac and it is freely available for everyone.
On Windows, you can use Putty, Bitvise or the GitBash (coming with ssh) which is also free. On Windows 10 since Update 1709, Microsoft has packaged "ssh" right into windows. You can thus open a cmd window (Start - type "cmd" - <ENTER>) and run ssh username@hostname.domain like you would with Linux or MacOS.

Sometimes access to a cluster's login nodes is restricted to certain networks within the university/facility, so you can connect while being on the campus, but not from your network at home or at other institutions. To nevertheless access those login nodes from external, one can 'pretend to be inside the network' by using a Virtual Private Network (VPN) provided by the university operating the cluster.

Usage

Logging in with OpenSSH on a Linux Cluster is done with:

$ ssh -l login@cluster

Here <login> is your username and <cluster> is one of the login nodes of the system, you are trying to connect to. At the first login you will be asked to verify the authenticity of the host. If the shown host is correct, enter yes. After pressing RETURN you will be prompted to enter your password for the provided username.

If you need to start graphical applications you need to enable X11 forwarding/X11 tunneling by your ssh client. For OpenSSH this is done by giving it the command line option -X (or -Y if the previous did not work):

$ ssh -X -l login@cluster

This might or might not work depending on the your operating system, because it requires an X11-Server running on your local machine, which is not available by default on Mac and Windows. To utilize graphical tools anyway, you might want to look into FastX, which provides the necessary functionality for Mac and Windows.

For more security and ease of use you should consider setting up authentication via ssh keys.

FAQs

slightly longer description

ssh manpage