Difference between revisions of "Accessing the cluster"
From ScientificComputing
(15 intermediate revisions by the same user not shown) | |||
Line 38: | Line 38: | ||
<tr valign=top> | <tr valign=top> | ||
<td style="width: 45%;"> | <td style="width: 45%;"> | ||
− | + | === From a terminal (Linux, MacOS, Git BASH, WSL) === | |
− | + | * Start a terminal | |
+ | * 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 | ||
− | |||
− | |||
− | |||
</td> | </td> | ||
<td style="width: 5%;> | <td style="width: 5%;> | ||
</td> | </td> | ||
<td style="width: 45%;"> | <td style="width: 45%;"> | ||
− | + | === For Windows users === | |
− | + | * [[How to access the cluster with MobaXterm]]: MobaXterm is a convenient tool for accessing the cluster as it includes an SSH client, a local shell and data transfer functions. | |
+ | * [[How to access the cluster with PuTTY]]: PuTTY is an SSH client and does not provide a local shell. WinSCP can import a saved PuTTY session to create a connection for data transfer. | ||
+ | * To run [[Jupyter on Euler and Leonhard Open|Jupyter Notebook]] or [[VSCode|VSCode on Euler]], use [https://gitforwindows.org/ Git BASH] or [https://docs.microsoft.com/en-us/windows/wsl/install WSL] | ||
</td> | </td> | ||
</tr> | </tr> | ||
Line 80: | Line 80: | ||
=== Login options === | === Login options === | ||
* To use GUI on the cluster | * To use GUI on the cluster | ||
− | ** | + | ** In MobaXterm, X11 forwarding is already included and enabled |
− | **Linux | + | ** In PuTTY, go to Connection > SSH > X11, check the box ''Enable X11 forwarding'' |
+ | ** From a terminal (Linux, MacOS, [https://gitforwindows.org/ Git BASH], [https://docs.microsoft.com/en-us/windows/wsl/install WSL]), users have to enable X11 forwarding when log in | ||
$ ssh -Y username@euler.ethz.ch | $ ssh -Y username@euler.ethz.ch | ||
− | * After a successful login with password, [[ | + | * After a successful login with password, [[Accessing_the_cluster#SSH_Keys|generate SSH keys for passwordless login]] |
Line 146: | Line 147: | ||
== SSH Keys == | == SSH Keys == | ||
− | * SSH keys allows passwordless login which is useful for file transfers, automated tasks and | + | * SSH keys allows passwordless login which is useful for file transfers, automated tasks and running interactive tools, such as [[Jupyter on Euler and Leonhard Open|Jupyter Notebook]] and [[VSCode]], on the cluster |
* When used properly, SSH keys are much safer than passwords | * When used properly, SSH keys are much safer than passwords | ||
* SSH keys always come in pairs: | * SSH keys always come in pairs: | ||
Line 153: | Line 154: | ||
** You can generate as many pairs as you like, e.g., one for each computer you intend 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 | * Keys should be protected with a passphrase | ||
− | * SSH key management | + | * You can unlock keys with SSH key management tools such as [https://www.ssh.com/academy/ssh/agent#starting-ssh-agent ssh-agent] and [https://linux.die.net/man/1/keychain keychain] |
− | |||
− | |||
<table> | <table> |
Revision as of 10:10, 27 January 2022
< Home |
Prerequisites
|
How to access the cluster
From a terminal (Linux, MacOS, Git BASH, WSL)
$ ssh username@euler.ethz.ch
|
For Windows users
|
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, automated tasks and running interactive tools, such as Jupyter Notebook and VSCode, on the cluster
- When used properly, SSH keys are much safer 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
- You can unlock keys with SSH key management tools such as ssh-agent and keychain
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 |