Access Harvard FASRC through vscode without entering password & two step code every time
I usually get annoyed when I need to enter the password
and two step verification
every time when I need to connect to the server via vscode.
Worst thing is, I need to go through the same process when,
- Opening a new folder on vscode
- If connection gets disrupted
Luckily there's a handy solution as documented in the FASRC Docs. I found that doc page through stackoverflow $^\star$.
The trick is to authentication only once, then send our extra SSH sessions (vscode) through that connection.
Step 1 - Modify the ~/.ssh/config
file
Step 2 - Open a background ssh connection
ssh -CX -o ServerAliveInterval=30 -fN harvard
🎉 Once you've done step #2 one time, vscode won't ask again for credentials because we have already setup a background ssh connection
I encourage you to read the original documentation for more comprehensive detail about these two steps.
Update : 2023.01.22 : For some reason this doesn't work if I try to initiate the first connection form the terminal. However if I do on vscode first then it works.