You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/setup_remotessh.md
+30-41Lines changed: 30 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ This tutorial will show you how to use VS Code to remotely develop and test on C
11
11
12
12
13
13
## 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).
@@ -20,41 +22,6 @@ If you haven't already, follow the [CAEN Linux Tutorial](setup_caen.html) so you
20
22
21
23
## Install and Configure Remote SSH Extension
22
24
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
-
<divclass="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:
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
84
51
85
52
<imgsrc="images/remotessh_03.png"width="768px" />
86
53
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
+
<imgsrc="images/remotessh_04.png"width="768px" />
88
57
89
58
<divclass="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
+
<divclass="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
+
<imgsrc="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:
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.
96
85
97
86
<imgsrc="images/remotessh_05.png"width="768px" />
98
87
<imgsrc="images/remotessh_06.png"width="768px" />
99
88
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).
0 commit comments