@@ -51,7 +51,7 @@ impressive than the [Top-500](https://www.top500.org). Clusters are often
51
51
maintained in computing centers that support several such systems, all sharing
52
52
common networking and storage to support common compute intensive tasks.
53
53
54
- ## Logging In
54
+ ## Secure Connections
55
55
56
56
The first step in using a cluster is to establish a connection from our laptop
57
57
to the cluster. When we are sitting at a computer (or standing, or holding it
@@ -101,18 +101,17 @@ through the use of SSH keys and an SSH agent to both strengthen your security
101
101
102
102
### Better Security With SSH Keys
103
103
104
- The [ Lesson Setup] ({{ page.root }}/setup) provides instructions for
105
- installing a [ shell application] [ setup-shell ] with [ SSH] [ setup-ssh ] .
106
- If you have not done so already, please open that shell application with a
107
- Unix-like command line interface to your system.
104
+ The [ Lesson Setup] ({{ page.root }}/setup) provides instructions for installing
105
+ a shell application with SSH. If you have not done so already, please open that
106
+ shell application with a Unix-like command line interface to your system.
108
107
109
108
SSH keys are an alternative method for authentication to obtain access to
110
109
remote computing systems. They can also be used for authentication when
111
110
transferring files or for accessing version control systems. In this section
112
111
you will create a pair of SSH keys:
113
112
114
113
* a private key which you keep on your own computer, and
115
- * a public key which is placed on any remote system you will access.
114
+ * a public key which can be placed on any remote system you will access.
116
115
117
116
> ## Private keys are your secure digital passport
118
117
>
@@ -180,7 +179,7 @@ Take a look in `~/.ssh` (use `ls ~/.ssh`). You should see two new files:
180
179
> Nothing is * less* secure than a private key with no password. If you skipped
181
180
> password entry by accident, go back and generate a new key pair * with* a
182
181
> strong password.
183
- {: .error }
182
+ {: .warning }
184
183
185
184
##### Use RSA for Older Systems
186
185
@@ -251,7 +250,7 @@ Take a look in the folder you specified. You should see two new files:
251
250
asks for a key, this is the one to send. It is also safe to upload to
252
251
websites such as GitHub: it is meant to be seen.
253
252
254
- ## SSH Agent for Easier Key Handling
253
+ ### SSH Agent for Easier Key Handling
255
254
256
255
An SSH key is only as strong as the password used to unlock it, but on the
257
256
other hand, typing out a complex password every time you connect to a machine
@@ -266,7 +265,7 @@ password safe, and removes the tedium of entering the password multiple times.
266
265
Just remember your password, because once it expires in the Agent, you have to
267
266
type it in again.
268
267
269
- ### SSH Agents on Linux, macOS, and Windows
268
+ #### SSH Agents on Linux, macOS, and Windows
270
269
271
270
Open your terminal application and check if an agent is running:
272
271
@@ -307,26 +306,38 @@ Lifetime set to 86400 seconds
307
306
For the duration (8 hours), whenever you use that key, the SSH Agent will
308
307
provide the key on your behalf without you having to type a single keystroke.
309
308
310
- ### SSH Agent on PuTTY
309
+ #### SSH Agent on PuTTY
311
310
312
311
If you are using PuTTY on Windows, download and use ` pageant ` as the SSH agent.
313
312
See the [ PuTTY documentation] [ putty-agent ] .
314
313
315
- ### Log in
314
+ ### Transfer Your Public Key
315
+
316
+ {% if site.remote.portal %}
317
+ Visit {{ site.remote.portal }} to upload your SSH public key.
318
+ {% else %}
319
+ Use the ** s** ecure ** c** o** p** y tool to send your public key to the cluster.
320
+
321
+ ```
322
+ {{ site.local.prompt }} scp ~/.ssh/id_ed25519.pub {{ site.remote.user }}@{{ site.remote.login }}:~/
323
+ ```
324
+ {: .language-bash}
325
+ {% endif %}
326
+
327
+ ## Log In to the Cluster
316
328
317
329
Go ahead and open your terminal or graphical SSH client, then log in to the
318
- cluster using your username and the remote computer you can reach from the
319
- outside world, {{ site.remote.location }} .
330
+ cluster. Replace ` {{ site. remote.user }} ` with your username or the one
331
+ supplied by the instructors .
320
332
321
333
```
322
334
{{ site.local.prompt }} ssh {{ site.remote.user }}@{{ site.remote.login }}
323
335
```
324
336
{: .language-bash}
325
337
326
- Remember to replace ` {{ site.remote.user }} ` with your username or the one
327
- supplied by the instructors. You may be asked for your password. Watch out: the
328
- characters you type after the password prompt are not displayed on the screen.
329
- Normal output will resume once you press ` Enter ` .
338
+ You may be asked for your password. Watch out: the characters you type after
339
+ the password prompt are not displayed on the screen. Normal output will resume
340
+ once you press ` Enter ` .
330
341
331
342
You may have noticed that the prompt changed when you logged into the remote
332
343
system using the terminal (if you logged in using PuTTY this will not apply
@@ -345,7 +356,7 @@ following convention:
345
356
terminal connected to the remote system
346
357
- ` $ ` when it really doesn't matter which system the terminal is connected to.
347
358
348
- ## Looking Around
359
+ ## Looking Around Your Remote Home
349
360
350
361
Very often, many users are tempted to think of a high-performance computing
351
362
installation as one giant, magical machine. Sometimes, people will assume that
@@ -394,16 +405,56 @@ double-check, include hidden files in your directory listing:
394
405
```
395
406
{: .language-bash}
396
407
```
397
- . .bashrc
408
+ . .bashrc id_ed25519.pub
398
409
.. .ssh
399
410
```
400
411
{: .output}
401
412
402
413
In the first column, ` . ` is a reference to the current directory and ` .. ` a
403
414
reference to its parent (` {{ site.remote.homedir }} ` ). You may or may not see
404
- the other two files, or files like them: ` .bashrc ` is a shell configuration
405
- file, which you can edit with your preferences; and ` .ssh ` is a directory
406
- storing SSH keys and a record of authorized connections.
415
+ the other files, or files like them: ` .bashrc ` is a shell configuration file,
416
+ which you can edit with your preferences; and ` .ssh ` is a directory storing SSH
417
+ keys and a record of authorized connections.
418
+
419
+ ### Install Your SSH Key
420
+
421
+ If you transferred your SSH public key with ` scp ` , you should see
422
+ ` id_ed25519.pub ` in your home directory. To "install" this key, it must be
423
+ listed in a file named ` authorized_keys ` under the ` .ssh ` folder.
424
+
425
+ If the ` .ssh ` folder was not listed above, then it does not yet exist: create it.
426
+
427
+ ```
428
+ {{ site.remote.prompt }} mkdir ~/.ssh
429
+ ```
430
+ {: .language-bash}
431
+
432
+ Now, use ` cat ` to print your public key, but redirect the output, appending it
433
+ to the ` authorized_keys ` file:
434
+
435
+ ```
436
+ {{ site.remote.prompt }} cat ~/id_ed25519.pub >> ~/.ssh/authorized_keys
437
+ ```
438
+ {: .language-bash}
439
+
440
+ That's all! Disconnect, then try to log back into the remote: if your key and
441
+ agent have been configured correctly, you should not be prompted for a password.
442
+
443
+ ```
444
+ {{ site.remote.prompt }} logout
445
+ ```
446
+ {: .language-bash}
447
+
448
+ ```
449
+ {{ site.local.prompt }} ssh {{ site.remote.user }}@{{ site.remote.login }}
450
+ ```
451
+ {: .language-bash}
452
+
453
+
454
+ ```
455
+ {{ site.remote.prompt }} ls
456
+ ```
457
+ {: .language-bash}
407
458
408
459
> ## What's different between your machine and the remote?
409
460
>
@@ -429,6 +480,8 @@ storing SSH keys and a record of authorized connections.
429
480
> {: .solution}
430
481
{: .discussion}
431
482
483
+ ## Look Around the Rest of the System
484
+
432
485
Most high-performance computing systems run the Linux operating system, which
433
486
is built around the UNIX [Filesystem Hierarchy Standard][fshs]. Instead of
434
487
having a separate root for each hard drive or storage medium, all files and
0 commit comments