Difference between revisions of "SSH"
(36 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Basics]] | ||
== General == | == General == | ||
− | + | SSH, also known as Secure Shell, is a [[shell|command-line]] tool that allows users to log into a remote computer over a network (e.g. the internet) and execute commands on that machine. This enables an interaction with the remote computer as if the user would be physically present. So using its [[shell]], ssh is commonly used to access the [[Nodes#Login|login nodes]] of supercomputers. | |
+ | |||
+ | __TOC__ | ||
== Access == | == Access == | ||
− | OpenSSH is the standard ssh client | + | OpenSSH is the standard ssh client for ''Linux'' and ''Mac'' operating systems, and is freely available to all users. <br /> |
+ | For ''Windows'' users, options include Putty, MobaXterm, Bitvise or the GitBash (coming with ssh) all of which are also free. Since Windows 10 Update 1709, Microsoft has integrated "ssh" into the system, allowing users to easily connect by opening a cmd window and running the "ssh" command. You can thus open a '''cmd''' window (Start - type "cmd" - <ENTER>) and run <code>ssh <username | University ID | Institution ID> @ <hostname.domain | IP Adresse> </code> like you would with Linux or MacOS. Additionally, Microsoft has allowed users of windows 10 and later versions, to run a Linux distribution alongside their Windows environment by implementing Windows Subsystem for Linux or WSL. This feature enables users to enjoy the benefits of both a Windows operating system and a Linux environment without the need for dual-booting or virtualization, providing a compatibility layer that allows Linux system calls to be translated into Windows system calls. This allows users to run Linux binaries natively on their Windows system without the need for a separate Linux virtual machine. | ||
+ | Please note, that access to the cluster's login nodes is in almost all cases restricted to specific networks within a university or facility, making it necessary to connect from a campus network rather than from elsewhere. In such cases, users can use a [[VPN|Virtual Private Network (VPN)]] provided by the university to access the login nodes remotely. | ||
+ | == Usage == | ||
+ | Logging in with OpenSSH on a Linux Cluster is done with: | ||
− | = | + | <hpc name="loginNode"> |
− | + | <code> | |
− | + | $ ssh -l login@cluster | |
+ | </code> | ||
+ | </hpc> | ||
+ | |||
+ | 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. | ||
+ | |||
+ | 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 <code>-X</code> (or <code>-Y</code> if the previous did not work): | ||
− | ssh -l < | + | <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. | |
− | |||
+ | 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] |
Latest revision as of 15:07, 22 May 2024
General
SSH, also known as Secure Shell, is a command-line tool that allows users to log into a remote computer over a network (e.g. the internet) and execute commands on that machine. This enables an interaction with the remote computer as if the user would be physically present. So using its shell, ssh is commonly used to access the login nodes of supercomputers.
Access
OpenSSH is the standard ssh client for Linux and Mac operating systems, and is freely available to all users.
For Windows users, options include Putty, MobaXterm, Bitvise or the GitBash (coming with ssh) all of which are also free. Since Windows 10 Update 1709, Microsoft has integrated "ssh" into the system, allowing users to easily connect by opening a cmd window and running the "ssh" command. You can thus open a cmd window (Start - type "cmd" - <ENTER>) and run ssh <username | University ID | Institution ID> @ <hostname.domain | IP Adresse>
like you would with Linux or MacOS. Additionally, Microsoft has allowed users of windows 10 and later versions, to run a Linux distribution alongside their Windows environment by implementing Windows Subsystem for Linux or WSL. This feature enables users to enjoy the benefits of both a Windows operating system and a Linux environment without the need for dual-booting or virtualization, providing a compatibility layer that allows Linux system calls to be translated into Windows system calls. This allows users to run Linux binaries natively on their Windows system without the need for a separate Linux virtual machine.
Please note, that access to the cluster's login nodes is in almost all cases restricted to specific networks within a university or facility, making it necessary to connect from a campus network rather than from elsewhere. In such cases, users can use a Virtual Private Network (VPN) provided by the university to access the login nodes remotely.
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.