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/hpc/02_connecting_to_hpc/01_connecting_to_hpc.md
+48-46Lines changed: 48 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,28 +12,33 @@ If you'd prefer to access the HPC cluster via a web gateway instead, please refe
12
12
13
13
The following sections will outline basic ways to connect to the Greene cluster. Access to the clusters is primarily handled via the Secure Shell Protocol, or ssh. Below we outline ways to connect via ssh on Mac, Linux, and Windows machines.
14
14
15
-
## Quick Start HPC Connection Guide
16
-
### Configuring Your SSH Client
17
-
To connect to HPC systems, it's important to configure your machine's SSH client. For Linux and Mac machines, the configuration file is the ~/.ssh/config file on your computer. These are the basic lines that should be added to your ~/.ssh/config file:
15
+
## Configuring Your SSH Client
16
+
17
+
To connect to HPC systems, you have to configure the SSH clienton your machine. We recommend the following configuration:
18
18
```sh
19
19
Host greene.hpc.nyu.edu dtn.hpc.nyu.edu
20
+
User <NetID>
20
21
StrictHostKeyChecking no
21
22
ServerAliveInterval 60
22
23
ForwardAgent yes
23
24
UserKnownHostsFile /dev/null
24
25
LogLevel ERROR
25
-
26
-
Host greene
27
-
HostName localhost
28
-
Port 8027
29
-
ForwardX11 yes
26
+
27
+
Host torch login.torch.hpc.nyu.edu
28
+
Hostname login.torch.hpc.nyu.edu
29
+
User <NetID>
30
30
StrictHostKeyChecking no
31
+
ServerAliveInterval 60
32
+
ForwardAgent yes
31
33
UserKnownHostsFile /dev/null
32
34
LogLevel ERROR
33
-
User <Your NetID>
34
35
```
35
-
### Setting Up an SSH Config File on Windows
36
-
For Windows, you can now follow a similar configuration setup. Using Powershell you can use the following to create and open a Windows SSH config file:
36
+
### MacOS/Linux
37
+
38
+
MacOS/Linux machines have SSH clients pre-installed. Using the editor of your choice, open the `~/.ssh/config` file on your machine and add the contents listed above.
39
+
40
+
### Windows
41
+
Using Powershell you can use the following to create and open a Windows SSH config file:
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@ -56,29 +60,14 @@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
56
60
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
57
61
It is also possible that a host key has just been changed.
58
62
```
59
-
63
+
Do not be alarmed - this is an issue that occurs because the Greene and Torch clusters have multiple login nodes. For instance, `greene.hpc.nyu.edu` resolves to one of three possible login nodes (`log-1`, `log-2`, and `log-3`). The configuration directive `StrictHostKeyChecking no` referenced in the recommended config above will prevent this error. Ensure that you have not missed adding it.
60
64
:::
61
65
62
-
Do not be alarmed - this is an issue that occurs because the cluster has multiple login nodes (`log-1`, `log-2`, and `log-3`) that `greene.hpc.nyu.edu` resolves to.
63
-
64
-
To avoid this warning, you can add these lines to your SSH configuration file. Open `~/.ssh/config` and place the following lines in it:
65
-
66
-
:::tip
67
-
This segment, referenced in the recommended config above will nullify the error:
68
-
69
-
```sh
70
-
Host greene.hpc.nyu.edu dtn.hpc.nyu.edu
71
-
StrictHostKeyChecking no
72
-
ServerAliveInterval 60
73
-
ForwardAgent yes
74
-
StrictHostKeyChecking no
75
-
UserKnownHostsFile /dev/null
76
-
LogLevel ERROR
77
-
```
78
-
The above will also fix SSH timeout errors by extending the `ServerAliveInterval` argument.
66
+
:::info SSH Timeout errors
67
+
SSH timeout errors can be fixed by extending the `ServerAliveInterval` argument.
79
68
:::
80
69
81
-
###Connecting to the NYU Network
70
+
## Connecting to the NYU Network
82
71
To access the HPC systems, you must either be on the NYU secure network (such as the NYU WiFi or a wired connection from an NYU office) or use the NYU VPN.
83
72
84
73
:::info Connecting to the HPC clusters from outside NYU Network
@@ -110,26 +99,39 @@ With [Windowns Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US
110
99
- If you are using WSL 2 (Windows subsystem for Linux 2), you may not be able to access internet when Cisco AnyConnect VPN, installed from exe file, is activated. A potential solution: uninstall Cisco AnyConnect and install AnyConnect using Microsoft Store, and then setup new VPN connection using settings described on [IT webpage][install vpn on windows link].
111
100
:::
112
101
113
-
## Additional Tips
114
-
Below are some additional options and tips for connecting to the HPC resources.
115
-
### Setting up SSH Keys
102
+
## Two-factor authentication for Torch
103
+
There is an extra layer of security when accessing Torch which is described below:
104
+
105
+
- Login as usual via the `ssh torch` command:
106
+

107
+
- Open [https://microsoft.com/devicelogin](https://microsoft.com/devicelogin)
108
+

109
+
- Copy and enter pin from terminal
110
+

111
+
- Enter or select your `<NetID>@nyu.edu` account
112
+

113
+
- Enter your password
114
+

115
+
- Complete MFA (click on Approve with MFA (Duo)
116
+

117
+

118
+

119
+
- Return to terminal and hit Enter
120
+

121
+
122
+
## SSH Keys for Greene
123
+
:::warning
124
+
SSH keys are not supported on Torch!
125
+
:::
116
126
117
127
Instead of typing your password every time you need to log in, you can also specify an ssh key.
118
128
119
129
- Only do that on the computer you trust
120
-
121
-
- Generate ssh key pair (terminal in Linux/Mac or cmd/WSL in Windows):
- Generate ssh key pair (terminal in Linux/Mac or cmd/WSL in Windows): [https://www.ssh.com/ssh/keygen/][ssh instructions keygen link]
124
131
- Note the path to ssh key files. Don't share key files with anybody - anybody with this key file can login to your account
125
-
126
132
- Log into cluster using regular login/password and then add the content of generated public key file (the one with .pub) to `$HOME/.ssh/authorized_keys` on cluster
127
-
128
133
- Next time you will log into cluster no password will be required
129
134
130
-
For additional recommendations on how to configure your SSH sessions, see the [ssh configuring and x11 forwarding page](./02_ssh_tunneling_and_x11_forwarding.md).
In rare cases when you need to interact with GUI applications on HPC clusters, you need to enable X11 forwarding for your SSH connection. Mac and Linux users will need to run the ssh commands described above with an additional flag:
6
+
7
+
```sh
8
+
ssh -Y <NYU_NetID>@greene.hpc.nyu.edu
9
+
```
10
+
11
+
However, Mac users need to install [XQuartz][xquartz], since X-server is no longer shipped with the macOS.
12
+
13
+
Windows users will also need to install X server software. We recommend using MobaXTerm. Further instructions are provided in the [introductory HPC tutorial](../12_tutorial_intro_shell_hpc/02_connecting_to_hpc.mdx).
0 commit comments