Cannot connect to server using Remote in VS code

Hi, I’m having trouble ssh’ing to the server in VS code. The connection was fine until I lost connection a few days ago. Since then, it repeatedly asks me for duo two-factor login authentication whenever I was trying to reconnect via VS code. Ssh’ing via terminal still works fine though.
Here is the login log I have:

[10:32:42.493] Log Level: 2
[10:32:42.497] remote-ssh@0.61.0
[10:32:42.497] darwin x64
[10:32:42.499] SSH Resolver called for “ssh-remote+7b22686f73744e616d65223a22646973636f76657279322e7573632e656475222c2275736572223a2274616f616e687561227d”, attempt 1
[10:32:42.499] “remote.SSH.useLocalServer”: true
[10:32:42.499] “remote.SSH.sshPath”: undefined
[10:32:42.499] “remote.SSH.sshConfigurationFile”: undefined
[10:32:42.499] “remote.SSH.useFlock”: true
[10:32:42.499] “remote.SSH.lockfilesInTmp”: false
[10:32:42.500] “remote.SSH.localServerDownload”: auto
[10:32:42.500] “remote.SSH.remoteServerListenOnSocket”: false
[10:32:42.500] “remote.SSH.showLoginTerminal”: false
[10:32:42.500] “remote.SSH.maxReconnectionAttempts”: 9007199254740991
[10:32:42.500] SSH Resolver called for host: taoanhua@discovery2.usc.edu
[10:32:42.501] Setting up SSH remote “discovery2.usc.edu”
[10:32:42.506] Acquiring local install lock: /var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-remote-ssh-taoanhua@discovery2.usc.edu-install.lock
[10:32:42.527] Looking for existing server data file at /Users/taoanhuang/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-taoanhua@discovery2.usc.edu-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.61.0/data.json
[10:32:42.527] Using commit id “e5a624b788d92b8d34d1392e4c4d9789406efe8f” and quality “stable” for server
[10:32:42.534] Install and start server if needed
[10:32:42.549] Checking ssh with “ssh -V”
[10:32:42.578] > OpenSSH_8.1p1, LibreSSL 2.7.3
[10:32:42.584] askpass server listening on /var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-3ea85a59d2fcfb2c6e3685094b7e18fb1c6a4420.sock
[10:32:42.584] Spawning local server with {“ipcHandlePath”:"/var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-1346063caafa63fdd24db8186aa64ee47b5395b1.sock",“sshCommand”:“ssh”,“sshArgs”:["-v","-T","-D",“60622”,"-o",“ConnectTimeout=15”,“taoanhua@discovery2.usc.edu”],“dataFilePath”:"/Users/taoanhuang/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-taoanhua@discovery2.usc.edu-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.61.0/data.json"}
[10:32:42.585] Local server env: {“DISPLAY”:“1”,“ELECTRON_RUN_AS_NODE”:“1”,“SSH_ASKPASS”:"/Users/taoanhuang/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/local-server/askpass.sh",“VSCODE_SSH_ASKPASS_NODE”:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)",“VSCODE_SSH_ASKPASS_MAIN”:"/Users/taoanhuang/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/askpass-main.js",“VSCODE_SSH_ASKPASS_HANDLE”:"/var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-3ea85a59d2fcfb2c6e3685094b7e18fb1c6a4420.sock"}
[10:32:42.595] Spawned 42341
[10:32:42.816] > local-server> Spawned ssh: 42342
[10:32:42.822] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[10:32:43.010] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:pO0FfPYahmoh/8UcgHpLKxdJe52fNuX9bCodsHI4rVE
[10:32:43.180] stderr> Authenticated with partial success.
[10:32:43.695] Got askpass request: {“request”:“Duo two-factor login for taoanhua Enter a passcode or select one of the following options: 1. Duo Push to XXX-XXX-3239 2. Phone call to XXX-XXX-3239 3. SMS passcodes to XXX-XXX-3239 (next code starts with: 2) Passcode or option (1-3):”}
[10:32:43.697] Listening for interwindow password on /var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-56f758346b18e407872c239dbf41745c78e6e392.sock
[10:32:43.697] Writing password prompt to globalState
[10:32:48.859] Interactor gave response: *
[10:32:48.860] Cleaning up other-window auth server
[10:32:58.103] stderr> Authenticated to discovery2.usc.edu ([68.181.11.6]:22).
[10:32:58.213] > Success. Logging you in…
[10:32:58.783] > ready: 0c102e0ac097
[10:32:58.817] > Linux 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020
[10:32:58.818] Platform: linux
[10:32:58.861] > 0c102e0ac097: running
[10:32:58.878] > Acquiring lock on /home1/taoanhua/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe8f/vscode-remote-lock.taoanhua.e5a624b788d92b8d34d1392e4c4d9789406efe8f

Installation already in progress…
0c102e0ac097: start
exitCode==24==
[10:32:58.879] > listeningOn====
osReleaseId==centos==
[10:32:58.882] > arch==x86_64==
tmpDir==/run/user/354380==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
0c102e0ac097: end
[10:32:58.882] Received install output:
exitCode==24==listeningOn====
osReleaseId==centos==arch==x86_64==
tmpDir==/run/user/354380==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
[10:32:58.886] Server installation process already in progress - waiting and retrying
[10:32:58.886] Terminating local server
[10:32:58.897] Local server exit: 15
[10:32:59.902] askpass server listening on /var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-75182a752ea2387c679c1fb399c8a6909e864219.sock
[10:32:59.903] Spawning local server with {“ipcHandlePath”:"/var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-08364e5699af7ea3ebbbe029a424d8a559814d95.sock",“sshCommand”:“ssh”,“sshArgs”:["-v","-T","-D",“60622”,"-o",“ConnectTimeout=15”,“taoanhua@discovery2.usc.edu”],“dataFilePath”:"/Users/taoanhuang/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-taoanhua@discovery2.usc.edu-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.61.0/data.json"}
[10:32:59.903] Local server env: {“DISPLAY”:“1”,“ELECTRON_RUN_AS_NODE”:“1”,“SSH_ASKPASS”:"/Users/taoanhuang/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/local-server/askpass.sh",“VSCODE_SSH_ASKPASS_NODE”:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)",“VSCODE_SSH_ASKPASS_MAIN”:"/Users/taoanhuang/.vscode/extensions/ms-vscode-remote.remote-ssh-0.61.0/out/askpass-main.js",“VSCODE_SSH_ASKPASS_HANDLE”:"/var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-75182a752ea2387c679c1fb399c8a6909e864219.sock"}
[10:32:59.917] Spawned 42350
[10:33:00.123] > local-server> Spawned ssh: 42351
[10:33:00.138] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[10:33:00.318] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:pO0FfPYahmoh/8UcgHpLKxdJe52fNuX9bCodsHI4rVE
[10:33:00.523] stderr> Authenticated with partial success.
[10:33:00.982] Got askpass request: {“request”:“Duo two-factor login for taoanhua Enter a passcode or select one of the following options: 1. Duo Push to XXX-XXX-3239 2. Phone call to XXX-XXX-3239 3. SMS passcodes to XXX-XXX-3239 (next code starts with: 2) Passcode or option (1-3):”}
[10:33:00.985] Listening for interwindow password on /var/folders/hl/xzs6_97j57b4dg1y62r8b2dc0000gn/T/vscode-ssh-askpass-450b9949ee602969eccbed2ba0468066c0970658.sock
[10:33:00.985] Writing password prompt to globalState

Hi,

I don’t know why this happens but it also happens to me. Here is one useful way I used to fix this problem. You can use the terminal to ssh into the cluster and then cd to your directory, /home1/xxx (xxx is your account name). Then rm -rf ./.vscode. And then use the VSCode to log in again and it will be all fine.

1 Like

Thank you, Cui.
I tried doing this “rm -rf ./.vscode-server/” several times but it still doesn’t work for me.

Checking through our logs, I see a mix of failed authentication attempts. It appears to be Duo related as well as lockouts due to too many failed authentications. Can you please try again and let me know:

  1. The result
  2. Which hostname you are using
  3. The approximate date and time of the attempt

Thanks!

Thanks, my issues have been resolved by trying some random fixes.
Previously, I was using discovery2 to log in. I made several attempts each day in the past few days (Dec 12-17).