I usually get annoyed when I need to enter the
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
The trick is to authentication only once, then send our extra SSH sessions (vscode) through that connection.
Step 1 - Modify the
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.