Difference between revisions of "Accessing the cluster"
From ScientificComputing
(→SSH Keys) |
|||
(26 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
<tr valign=top> | <tr valign=top> | ||
<td style="width: 50%; text-align:left"> | <td style="width: 50%; text-align:left"> | ||
− | < [[ | + | < [[Main_Page|Home]] |
</td> | </td> | ||
<td style="width: 50%; text-align:right"> | <td style="width: 50%; text-align:right"> | ||
Line 36: | Line 36: | ||
== How to access the cluster == | == How to access the cluster == | ||
* Start your SSH client | * Start your SSH client | ||
− | * Use ssh command to connect to the login node of Euler | + | * Use ssh command to connect to the login node of Euler |
− | ssh username@euler.ethz.ch | + | $ ssh username@euler.ethz.ch |
* Use your ETH credentials to log in | * Use your ETH credentials to log in | ||
<table style="width: 100%;"> | <table style="width: 100%;"> | ||
Line 81: | Line 81: | ||
{| class="wikitable" | style="background: white;" | {| class="wikitable" | style="background: white;" | ||
− | ! || Euler || | + | ! || Euler CPU || Euler GPU |
|- | |- | ||
− | | Shareholders who invest in the cluster resources || style="color:green; text-align: center;"| ✓ <br /> Euler shareholders ||style="color:green;text-align: center;"| ✓ <br /> | + | | Shareholders who invest in the cluster resources || style="color:green; text-align: center;"| ✓ <br /> Euler CPU shareholders ||style="color:green;text-align: center;"| ✓ <br /> Euler GPU shareholders |
|- | |- | ||
| External collaborators of shareholders || style="color:green;text-align:center;"| ✓ ||style="color:green;text-align: center;"| ✓ | | External collaborators of shareholders || style="color:green;text-align:center;"| ✓ ||style="color:green;text-align: center;"| ✓ | ||
Line 108: | Line 108: | ||
* To connect from outside of the ETH network to the cluster, establish first a [[Accessing_the_clusters#VPN|VPN connection]]. Then, connect to the cluster through SSH. | * To connect from outside of the ETH network to the cluster, establish first a [[Accessing_the_clusters#VPN|VPN connection]]. Then, connect to the cluster through SSH. | ||
* To connect from a compute node to an external service, use the ETH proxy service: | * To connect from a compute node to an external service, use the ETH proxy service: | ||
− | module load eth_proxy | + | $ module load eth_proxy |
=== Legal Compliance === | === Legal Compliance === | ||
Line 141: | Line 141: | ||
** [https://linux.die.net/man/1/keychain keychain] activates ssh-agent in every new terminal | ** [https://linux.die.net/man/1/keychain keychain] activates ssh-agent in every new terminal | ||
+ | <table> | ||
+ | <tr valign=center> | ||
+ | <td style="width: 30%; background: white;"> | ||
=== Step 1: Create your keys === | === Step 1: Create your keys === | ||
− | < | + | </td> |
+ | </tr> | ||
<tr valign=center> | <tr valign=center> | ||
− | <td style="width: | + | <td style="width: 30%; background: white;"> |
<br> | <br> | ||
[[Image:ssh_keys_gen.png|370px]] | [[Image:ssh_keys_gen.png|370px]] | ||
<br> | <br> | ||
</td> | </td> | ||
− | <td style="width: | + | <td style="width: 60%; background: white; text-align: left"> |
− | + | * First, verify whether logging in with password works | |
− | |||
− | |||
* Generate a key pair with the ed25519 algorithm for each computer you want to connect to | * Generate a key pair with the ed25519 algorithm for each computer you want to connect to | ||
Line 160: | Line 162: | ||
</td> | </td> | ||
</tr> | </tr> | ||
− | |||
+ | <tr valign=center> | ||
+ | <td style="width: 30%; background: white;"> | ||
=== Step 2: Copy the public key to the cluster === | === Step 2: Copy the public key to the cluster === | ||
− | < | + | </td> |
+ | </tr> | ||
+ | |||
<tr valign=center> | <tr valign=center> | ||
− | <td style="width: | + | <td style="width: 30%; background: white;"> |
− | |||
[[Image:ssh_keys_copy.png|370px]] | [[Image:ssh_keys_copy.png|370px]] | ||
− | |||
</td> | </td> | ||
− | <td style="width: | + | <td style="width: 60%; background: white; text-align: left;"> |
+ | $ ssh-copy-id -i $HOME/.ssh/id_ed25519_euler.pub username@euler.ethz.ch | ||
</td> | </td> | ||
− | < | + | </tr> |
− | |||
− | |||
− | |||
+ | <tr valign=center> | ||
+ | <td style="width: 30%; background: white;"> | ||
+ | === Step 3: Use keys with non-default names === | ||
</td> | </td> | ||
</tr> | </tr> | ||
− | |||
− | |||
− | |||
<tr valign=top> | <tr valign=top> | ||
− | <td style="width: | + | <td style="width: 30%; background: white;"> |
<br> | <br> | ||
[[Image:ssh_keys_connect.png|370px]] | [[Image:ssh_keys_connect.png|370px]] | ||
<br> | <br> | ||
</td> | </td> | ||
− | <td style="width: | + | <td style="width: 60%; background: white; text-align: left;"> |
− | |||
− | |||
The login commands become: | The login commands become: | ||
$ ssh -i $HOME/.ssh/id_ed25519_euler username@euler.ethz.ch | $ ssh -i $HOME/.ssh/id_ed25519_euler username@euler.ethz.ch | ||
− | |||
Alternatively, SSH clients can use this option automatically by adding the option IdentityFile in your $HOME/.ssh/config file, e.g.: | Alternatively, SSH clients can use this option automatically by adding the option IdentityFile in your $HOME/.ssh/config file, e.g.: | ||
Line 211: | Line 209: | ||
</tr> | </tr> | ||
</table> | </table> | ||
+ | |||
+ | === SSH key management with SSH Agent === | ||
+ | As we have to enter the passphrase to unlock the keys, it takes away the convenience of passwordless login. We can use an SSH agent (ssh-agent) to unlock the SSH keys. | ||
+ | $ eval `ssh-agent` | ||
+ | Agent pid 17906 | ||
+ | |||
+ | $ ssh-add $HOME/.ssh/id_ed25519_euler | ||
+ | Enter passphrase for id_ed25519_euler: | ||
+ | Identity added: id_ed15519_euler (username@local-computer-name) | ||
== Further reading == | == Further reading == | ||
* [[New_account_request_process_for_HPC_clusters| New account request process for HPC clusters]] | * [[New_account_request_process_for_HPC_clusters| New account request process for HPC clusters]] | ||
* [[Accessing_the_clusters|User guide: Accessing the clusters]] | * [[Accessing_the_clusters|User guide: Accessing the clusters]] | ||
+ | * [[Getting_started_with_clusters#Troubleshooting | Troubleshooting]] | ||
Line 220: | Line 228: | ||
<tr valign=top> | <tr valign=top> | ||
<td style="width: 50%; text-align:left"> | <td style="width: 50%; text-align:left"> | ||
− | < [[ | + | < [[Main_Page|Home]] |
</td> | </td> | ||
<td style="width: 50%; text-align:right"> | <td style="width: 50%; text-align:right"> |
Revision as of 13:44, 19 November 2021
< Home |
Prerequisites
|
How to access the cluster
- Start your SSH client
- Use ssh command to connect to the login node of Euler
$ ssh username@euler.ethz.ch
- Use your ETH credentials to log in
For new users and unverified accounts
An access code has been sent to your ETH email address. Enter the access code at the prompt below. If you do not receive the access code within a few minutes, then contact us by opening a ticket at http://smartdesk.ethz.ch Access code (ending in ******Ls): |
Login options
$ ssh -Y username@euler.ethz.ch
|
Who can access the cluster
|
External collaboratorsMembers of other institutions who have a collaboration with a research group at ETH may use the clusters for the purpose of said collaboration
|
Security
$ module load eth_proxy Legal ComplianceThe HPC clusters are subject to ETH’s acceptable use policy for IT resources (Benutzungsordnung für Telematik (BOT)), in particular:
|
Consequences:
- In case of abuse, the offender’s account may be blocked temporarily or closed
- System administrators are obliged by law to investigate abusive or illegal activities and report them to the relevant authorities
SSH Keys
- SSH keys allows passwordless login which is useful for file transfers and automated tasks
- When used properly, SSH keys are much safter than passwords
- SSH keys always come in pairs:
- A private key, stored on your local workstation (and nowhere else!)
- A public key, stored on the computer(s) you want to connect to
- You can generate as many pairs as you like, e.g., one for each computer you intend to connect to
- Keys should be protected with a passphrase
- SSH key management
Step 1: Create your keys |
|
$ ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519_euler
|
|
Step 2: Copy the public key to the cluster |
|
$ ssh-copy-id -i $HOME/.ssh/id_ed25519_euler.pub username@euler.ethz.ch |
|
Step 3: Use keys with non-default names |
|
The login commands become: $ ssh -i $HOME/.ssh/id_ed25519_euler username@euler.ethz.ch Alternatively, SSH clients can use this option automatically by adding the option IdentityFile in your $HOME/.ssh/config file, e.g.: Host euler HostName euler.ethz.ch User username IdentityFile ~/.ssh/id_ed25519_euler Next time you login, you can type $ ssh euler |
SSH key management with SSH Agent
As we have to enter the passphrase to unlock the keys, it takes away the convenience of passwordless login. We can use an SSH agent (ssh-agent) to unlock the SSH keys.
$ eval `ssh-agent` Agent pid 17906 $ ssh-add $HOME/.ssh/id_ed25519_euler Enter passphrase for id_ed25519_euler: Identity added: id_ed15519_euler (username@local-computer-name)
Further reading
< Home |