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