Access Harvard FASRC through vscode without entering password & two step code every time


I usually get annoyed when I need to enter thepasswordandtwo step verificationevery time when I need to connect to the server via vscode.

Worst thing is, I need to go through the same process when,

Figure 1: Two step verification to connect through SSH

Figure 2: Two step verification to connect through SSH

Luckily there’s a handy solution as documented in theFASRC Docs . I found that doc page throughstackoverflow . I didn’t know the correct keywords to get to that doc page

The trick is to authentication only once, then send our extra SSH sessions (vscode) through that connection.

Step 1 - Modify the  /.ssh/config file

Figure 3:

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 theoriginal 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.