Skip to content

Commit 703b3fa

Browse files
authored
rewrite ssh docs to provide better advice on ela -> cluster (#16)
1 parent 518d839 commit 703b3fa

File tree

4 files changed

+70
-44
lines changed

4 files changed

+70
-44
lines changed

docs/access/ssh.md

Lines changed: 68 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
Before accessing CSCS clusters using SSH, first ensure that you have [created a user account][account-management] that is part of a project that has access to the cluster, and have [multi factor authentification][mfa] configured.
55

6-
It is not possible to authenticate with a username/password and user-created SSH keys: it is necessary to use a certified SSH key created using the CSCS SSHService, which is documented below.
6+
[](){#sshservice}
7+
## Generating Keys with SSHService
8+
9+
It is not possible to authenticate with a username/password and user-created SSH keys.
10+
Instead, it is necessary to use a certified SSH key created using the CSCS SSHService.
711

812
!!! note
913
Keys are valid for 24 hours, after which a new key must be generated.
@@ -12,8 +16,6 @@ It is not possible to authenticate with a username/password and user-created SSH
1216
The number of certified SSH keys is limited to **five per day**.
1317
Once you have reached this number you will not be able to generate new keys until at least one of these key expires or keys are revoked.
1418

15-
## Generating Keys with SSHService
16-
1719
There are two methods for generating SSH keys using the SSHService, the [SSHService web app](https://sshservice.cscs.ch/) or by using a [command-line script](https://github.com/eth-cscs/sshservice-cli).
1820

1921
### Getting keys via the command line
@@ -81,63 +83,93 @@ mv /download/location/cscs-key ~/.ssh/cscs-key
8183
chmod 0600 ~/.ssh/cscs-key
8284
```
8385

84-
## Logging in with the generated keys
86+
### Adding a password to the key
87+
88+
Once the key has been generated using either the CLI or web interface above, it is strongly reccomended that you add a password to the generated key using the [ssh-keygen](https://www.ssh.com/academy/ssh/keygen) tool.
8589

86-
Set up a passphrase on the private key:
8790
```
8891
ssh-keygen -f ~/.ssh/cscs-key -p
8992
```
9093

91-
Add the key to the SSH agent:
94+
## Logging In
95+
96+
To ensure secure access, CSCS requires users to connect through the designated jump host Ela (`ela.cscs.ch`) before accessing any cluster.
97+
98+
Before trying to log into your target cluster, you can first check that the SSH key generated above can be used to access Ela:
9299
```
93-
ssh-add -t 1d ~/.ssh/cscs-key
100+
ssh -i ~/.ssh/cscs-key ela.cscs.ch
94101
```
95102

96-
??? warning "Could not open a connection to your authentification agent"
97-
If you see this error message, the ssh agent is not running.
98-
You can start it with the following command:
99-
```
100-
eval $(ssh-agent)
101-
```
102-
103-
Once the key has been configured, you can log in to CSCS' login system Ela:
104-
```bash
105-
# log in to ela.cscs.ch
106-
103+
To log into a target system at CSCS, you need to perform some additional setup to handle forwarding of SSH keys generated using the SSHService.
104+
There are two alternatives detailed below.
107105

108-
# then jump to a cluster
109-
> ssh clariden
110-
```
106+
### Adding Ela as a jump host in SSH Configuration
111107

112-
### Set up SSH Config
108+
This approach configures Ela as a jump host and creates aliases for the systems that you want to access in `~/.ssh/config` on your laptop or PC.
109+
The benefit of this approach is that once the `~/.ssh/config` file has been configured, no additional steps are required between creating a new key using MFA, and logging in.
113110

114-
To simplify logging in, you can edit (or create) the SSH configuration file `$HOME/.ssh/config` on your laptop or PC.
115-
A simple configuration for that simplifies logging into [Clariden][clariden] is:
111+
Below is an example `~./.ssh/config` file that facilitates directly logging into the Daint, Santis and Clariden clusters using `ela.cscs.ch` as a Jump host:
116112

117113
```
118114
Host ela
119115
HostName ela.cscs.ch
120-
ForwardAgent yes
121-
# replace with your CSCS username
122-
User username
116+
User cscsusername
117+
IdentityFile ~/.ssh/cscs-key
118+
119+
Host daint
120+
HostName daint.alps.cscs.ch
121+
User cscsusername
122+
ProxyJump ela
123+
IdentityFile ~/.ssh/cscs-key
124+
IdentitiesOnly yes
125+
126+
Host santis
127+
HostName santis.alps.cscs.ch
128+
ProxyJump ela
129+
User cscsusername
130+
IdentityFile ~/.ssh/cscs-key
131+
IdentitiesOnly yes
123132
124133
Host clariden
125134
HostName clariden.alps.cscs.ch
126135
ProxyJump ela
127-
# replace with your CSCS username
128-
User username
136+
User cscsusername
137+
IdentityFile ~/.ssh/cscs-key
138+
IdentitiesOnly yes
139+
```
129140

130-
Host daint
131-
HostName daint.alps.cscs.ch
132-
ProxyJump ela
133-
# replace with your CSCS username
134-
User username
141+
!!! note ""
142+
:exclamation: Replace `cscsusername` with your CSCS username in the file above.
143+
144+
After saving this file, one can directly log into `daint.alps.cscs.ch` from your local system using the alias `daint`:
145+
146+
```
147+
ssh daint
135148
```
136149

137-
With this configuration, you can log into Clariden directly using the name clariden that was defined in `Host clariden`.
150+
### Using SSH Agent
151+
152+
Alternatively, the [SSH authentification agent](https://www.ssh.com/academy/ssh/add-command) can be configured to manage the keys.
138153

154+
Each time a new key is generated using the [SSHService][sshservice], add the key to the SSH agent:
155+
```
156+
ssh-add -t 1d ~/.ssh/cscs-key
157+
```
158+
159+
??? warning "Could not open a connection to your authentification agent"
160+
If you see this error message, the ssh agent is not running.
161+
You can start it with the following command:
162+
```
163+
eval $(ssh-agent)
164+
```
165+
166+
Once the key has been configured, log into Ela using the `-A` flag, and then jump to the target system:
139167
```bash
140-
ssh clariden
168+
# log in to ela.cscs.ch
169+
170+
171+
# then jump to a cluster
172+
ssh daint.cscs.ch
141173
```
142174

143175
## Frequently encountered issues

docs/faq/index.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/stylesheets/extra.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
/* light mode: pale yellow background, solid black foreground */
9292
[data-md-color-scheme="default"] {
93-
--md-code-bg-color: #fcfafa;
93+
--md-code-bg-color: #fdfdfd;
9494
--md-code-fg-color: #000000;
9595
}
9696

@@ -102,7 +102,7 @@
102102

103103
/* Light mode */
104104
[data-md-color-scheme="default"] .md-typeset pre {
105-
border: 2px solid #fcb8b8;
105+
border: 2px solid #b4b4b4;
106106
border-radius: 2px; /* slight rounding to corners */
107107
}
108108

mkdocs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ nav:
7373
- 'Data Transfer': storage/transfer.md
7474
- 'Long Term Storage': storage/longterm.md
7575
- 'Object Storage': storage/object.md
76-
- 'Frequently asked questions':
77-
- faq/index.md
7876
theme:
7977
name: material
8078
language: en

0 commit comments

Comments
 (0)