Skip to content

Commit 7acffb9

Browse files
committed
Disperse SSH config section into pro-tip/prereq
1 parent 87ea32e commit 7acffb9

File tree

3 files changed

+30
-41
lines changed

3 files changed

+30
-41
lines changed

docs/images/remotessh_04.png

-48.6 KB
Loading

docs/images/remotessh_12.png

144 KB
Loading

docs/setup_remotessh.md

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ This tutorial will show you how to use VS Code to remotely develop and test on C
1111

1212

1313
## Prerequisites
14-
If you haven't already, follow the [CAEN Linux Tutorial](setup_caen.html) so your CAEN environment is ready for VS Code to access. If you need a refresher on VS code, read through the [tutorial](setup_vscode.html).
14+
If you haven't already, follow the [CAEN Linux Tutorial](setup_caen.html) to prepare your CAEN environment for VS Code access. Be sure to set up [SSH multiplexing](setup_caen.html#avoiding-repeated-2fa). This can help you avoid repeated 2FA prompts when connecting.
15+
16+
If you need a refresher on VS code, read through the [tutorial](setup_vscode.html).
1517

1618

1719
<div class="primer-spec-callout warning" markdown="1">
@@ -20,41 +22,6 @@ If you haven't already, follow the [CAEN Linux Tutorial](setup_caen.html) so you
2022

2123
## Install and Configure Remote SSH Extension
2224

23-
### Edit SSH Config
24-
First, we need to specify CAEN as a host in our SSH config file so VS Code knows where to connect. You can find the file at `~/.ssh/config`.
25-
26-
Make sure you set up [SSH multiplexing](setup_caen.html#avoiding-repeated-2fa) from the CAEN Linux Tutorial if you haven't already. This can help you avoid repeated 2FA prompts when connecting.
27-
28-
Add the following lines to the SSH config file, replacing `<uniqname>` with your own uniqname.
29-
```
30-
Host caen #(Can be named anything you like)
31-
HostName login.engin.umich.edu
32-
User <uniqname>
33-
```
34-
35-
Verify the contents of your `~/.ssh/config` file.
36-
```console
37-
$ cat ~/.ssh/config
38-
# SSH multiplexing (from CAEN Linux Tutorial)
39-
Host *
40-
ControlMaster auto
41-
ControlPersist yes
42-
ControlPath ~/.ssh/socket-%C
43-
ServerAliveInterval 60
44-
ServerAliveCountMax 5
45-
46-
Host caen
47-
HostName login.engin.umich.edu
48-
User armaanr
49-
```
50-
51-
<div class="primer-spec-callout info" markdown="1">
52-
**Pro-tip:** Adding hosts in this manner also gives you an easy way to SSH without needing to remember the hostname. For example:
53-
```console
54-
$ ssh caen
55-
([email protected]) Password:
56-
```
57-
</div>
5825

5926
### Install Extension
6027
Open up VS Code and install the [Remote - SSH Extension](https://aka.ms/vscode-remote/download/ssh).
@@ -84,20 +51,42 @@ Click the remote connection button on the bottom left and then click the "Connec
8451

8552
<img src="images/remotessh_03.png" width="768px" />
8653

87-
Click on the "caen" option (this is the SSH host that we set up [earlier](#edit-ssh-config)).
54+
Type in `<uniqname>@login-course.engin.umich.edu` and hit <kbd>Enter</kbd>.
55+
56+
<img src="images/remotessh_04.png" width="768px" />
8857

8958
<div class="primer-spec-callout info" markdown="1">
90-
If you want to connect to some other host in the future, you can manually specify `user@host` in this box too (e.g. `[email protected]`).
59+
If you want to connect to some other host in the future, you can follow these steps with any `user@host` (e.g. `[email protected]`).
60+
</div>
61+
62+
<div class="primer-spec-callout info" markdown="1">
63+
**Pro-tip:** If you don't want to type this every single time, you can add the information to your SSH config file. You can find the file at `~/.ssh/config`.
64+
65+
Add the following lines, replacing `<uniqname>` with your own uniqname.
66+
```
67+
Host caen
68+
HostName login-course.engin.umich.edu
69+
User <uniqname>
70+
```
71+
72+
You should now be able to just click on the "caen" option.
73+
74+
<img src="images/remotessh_12.png" width="768px" />
75+
76+
As an added bonus, adding hosts in this manner also gives you an easy way to SSH when using the terminal. For example:
77+
```console
78+
$ ssh caen
79+
([email protected]) Password:
80+
```
9181
</div>
9282

93-
<img src="images/remotessh_04.png" width="768px" />
9483

95-
Finally, you will be prompted for your CAEN password and Duo 2FA. The Duo 2FA prompt may be cut off. You can hover your mouse over the box and the full prompt will be shown.
84+
Finally, you will be prompted for your CAEN password and Duo 2FA. The Duo 2FA prompt may be cut off, but it's the same one you usually see when using SSH in the terminal. You can hover your mouse over the box and the full prompt will be shown.
9685

9786
<img src="images/remotessh_05.png" width="768px" />
9887
<img src="images/remotessh_06.png" width="768px" />
9988

100-
Now, the button in the bottom left should say "SSH: caen" (or whatever host you specified earlier).
89+
Now, the button in the bottom left should say "SSH: login-course.engin.umich.edu" (or "SSH: caen" if you used the SSH config file).
10190

10291
<img src="images/remotessh_07.png" width="768px" />
10392

0 commit comments

Comments
 (0)