microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.62k stars 28.67k forks source link

Remote SSH prompts to enter passphrase multiple times #204321

Closed heryandjaruma closed 7 months ago

heryandjaruma commented 7 months ago

Steps to Reproduce:

  1. Connect to any SSH host
  2. Vscode then prompts to enter passphrase multiple times (usually twice). Tried with different host and it does the same.
roblourens commented 7 months ago

Please share the log from the Remote-SSH output channel, thanks

heryandjaruma commented 7 months ago

Sure here they are.

[08:09:10.739] Log Level: 2
[08:09:10.744] VS Code version: 1.86.0
[08:09:10.744] Remote-SSH version: remote-ssh@0.108.0
[08:09:10.744] darwin arm64
[08:09:10.744] SSH Resolver called for "ssh-remote+112.12.11.134", attempt 1
[08:09:10.744] "remote.SSH.useLocalServer": true
[08:09:10.745] "remote.SSH.useExecServer": false
[08:09:10.745] "remote.SSH.path": undefined
[08:09:10.745] "remote.SSH.configFile": undefined
[08:09:10.745] "remote.SSH.useFlock": true
[08:09:10.745] "remote.SSH.lockfilesInTmp": false
[08:09:10.745] "remote.SSH.localServerDownload": auto
[08:09:10.745] "remote.SSH.remoteServerListenOnSocket": false
[08:09:10.745] "remote.SSH.showLoginTerminal": false
[08:09:10.745] "remote.SSH.defaultExtensions": []
[08:09:10.745] "remote.SSH.loglevel": 2
[08:09:10.745] "remote.SSH.enableDynamicForwarding": true
[08:09:10.746] "remote.SSH.enableRemoteCommand": false
[08:09:10.746] "remote.SSH.serverPickPortsFromRange": {}
[08:09:10.746] "remote.SSH.serverInstallPath": {}
[08:09:10.748] SSH Resolver called for host: 112.12.11.134
[08:09:10.748] Setting up SSH remote "112.12.11.134"
[08:09:10.749] Acquiring local install lock: /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-remote-ssh-1b3e6ad0-install.lock
[08:09:10.750] Looking for existing server data file at /Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-tr/data.json
[08:09:10.750] Using commit id "05047486b6df5eb8d44b2ecd70ea3bdf775fd937" and quality "stable" for server
[08:09:10.752] Install and start server if needed
[08:09:10.752] PATH: /Users/nayr/Qt/6.6.1/macos/bin:/usr/local/mysql/bin:/Users/nayr/Library/Application Support/Herd/bin/:/opt/homebrew/opt/gcc/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/gcc/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin
[08:09:10.752] Checking ssh with "ssh -V"
[08:09:10.757] > OpenSSH_9.4p1, LibreSSL 3.3.6

[08:09:10.757] askpass server listening on /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-530700f30af1f6a8ae3256de5999f1db6db6706e.sock
[08:09:10.758] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-8761e034d0981a42b6740ddf6e60871c974e45a8.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","58190","-o","ConnectTimeout=15","112.12.11.134"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-tr/data.json"}
[08:09:10.758] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.mzco6wJwef/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/nayr/.vscode/extensions/ms-vscode-remote.remote-ssh-0.108.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/nayr/.vscode/extensions/ms-vscode-remote.remote-ssh-0.108.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-530700f30af1f6a8ae3256de5999f1db6db6706e.sock"}
[08:09:10.759] Spawned 42901
[08:09:10.864] > local-server-1> Running ssh connection command: ssh -v -T -D 58190 -o ConnectTimeout=15 112.12.11.134
[08:09:10.865] > local-server-1> Spawned ssh, pid=42911
[08:09:10.868] stderr> OpenSSH_9.4p1, LibreSSL 3.3.6
[08:09:11.029] stderr> debug1: Server host key: ssh-ed25519 SHA256:xCYoBzFJ0C4rFLx6OE1bke8LDuAsTZzxRuTmFmCtGvI
[08:09:11.304] Got askpass request: {"request":" root@112.12.11.134's password:"}
[08:09:11.304] Showing password prompt
[08:09:11.304] Listening for interwindow password on /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-aef587a06e5c6355c434f1ee0d8583e0593811cc.sock
[08:09:11.304] Writing password prompt to globalState
[08:09:19.366] Got password response
[08:09:19.367] Interactor gave response: **************
[08:09:19.367] Cleaning up other-window auth server
[08:09:19.416] stderr> Authenticated to 112.12.11.134 ([112.12.11.134]:22) using "password".
[08:09:19.512] > Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-92-generic x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> 
>   System information as of Tue Feb  6 01:08:45 UTC 2024
> 
>   System load:  0.005859375        Users logged in:       1
>   Usage of /:   32.3% of 24.05GB   IPv4 address for eth0: 112.12.11.134
>   Memory usage: 27%                IPv4 address for eth0: 10.15.0.6
>   Swap usage:   0%                 IPv4 address for eth1: 10.104.0.3
>   Processes:    113
> 
>  * Introducing Expanded Security Maintenance for Applications.
>    Receive updates to over 25,000 software packages with your
>    Ubuntu Pro subscription. Free for personal use.
> 
>      https://ubuntu.com/pro
> 
> Expanded Security Maintenance for Applications is not enabled.
> 
> 73 updates can be applied immediately.
> To see these additional updates run: apt list --upgradable
> 
> Enable ESM Apps to receive additional future security updates.
> See https://ubuntu.com/esm or run: sudo pro status
> 
> 
> The list of available updates is more than a week old.
> To check for new updates run: sudo apt update
[08:09:19.541] > ready: 57139796866b
[08:09:19.567] > Linux 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024
[08:09:19.567] Platform: linux
[08:09:19.591] > /bin/bash
[08:09:19.591] Shell: bash
[08:09:19.591] Creating bash subshell inside "bash"
[08:09:19.619] > bash version:  5.1.16(1)-release
[08:09:19.659] > 57139796866b: running
[08:09:19.681] > Acquiring lock on /root/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/vscode-remote-lock.root.05047486b6df5eb8d44b2ecd70ea3bdf775fd937
[08:09:19.684] > Found existing installation at /root/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937...
> Checking /root/.vscode-server/.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log and /root/.vscode-server/.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.pid for a running server
> Looking for server with pid: 508997
[08:09:19.695] > Found running server...
>  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
[08:09:19.708] > Checking server status on port 37491 with wget
[08:09:19.714] > 57139796866b: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==37491==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==a11a1111-1aa1-11aa-a1a1-11a11aa1a1aa==
> 57139796866b: end
[08:09:19.714] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==37491==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/0==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==a11a1111-1aa1-11aa-a1a1-11a11aa1a1aa==

[08:09:19.714] Remote server is listening on port 37491
[08:09:19.715] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":37491},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/0","platform":"linux","connectionToken":"a11a1111-1aa1-11aa-a1a1-11a11aa1a1aa"},"installUnpackCode":""}
[08:09:19.715] Persisting server connection details to /Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-tr/data.json
[08:09:19.718] Starting forwarding server. local port 58192 -> socksPort 58190 -> remotePort 37491
[08:09:19.719] Forwarding server listening on port 58192
[08:09:19.719] Waiting for ssh tunnel to be ready
[08:09:19.720] Tunneled port 37491 to local port 58192
[08:09:19.720] Resolved "ssh-remote+112.12.11.134" to "port 58192"
[08:09:19.722] [Forwarding server port 58192] Got connection 0
[08:09:19.728] ------

[08:09:19.740] [Forwarding server port 58192] Got connection 1
[08:09:19.802] [Forwarding server port 58192] Got connection 2
[08:09:20.542] [Forwarding server port 58192] Got connection 3
[08:09:21.861] Opening exec server for ssh-remote+112.12.11.134
[08:09:21.861] Opening exec server for ssh-remote+112.12.11.134
[08:09:21.865] Initizing new exec server for ssh-remote+112.12.11.134
[08:09:21.876] Acquiring local install lock: /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-remote-ssh-1b3e6ad0-install.lock
[08:09:21.877] Looking for existing server data file at /Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-es/data.json
[08:09:21.878] Using commit id "05047486b6df5eb8d44b2ecd70ea3bdf775fd937" and quality "stable" for server
[08:09:21.879] Install and start server if needed
[08:09:21.880] askpass server listening on /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-f24e5f3e6e6b9074bb0371f9979097c39e011c20.sock
[08:09:21.880] Spawning local server with {"serverId":2,"ipcHandlePath":"/var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-e84fec56a3df01a4069da58c3048e2f45ce0436c.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","58206","-o","ConnectTimeout=15","112.12.11.134"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-es/data.json"}
[08:09:21.880] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.mzco6wJwef/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/nayr/.vscode/extensions/ms-vscode-remote.remote-ssh-0.108.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/nayr/.vscode/extensions/ms-vscode-remote.remote-ssh-0.108.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-f24e5f3e6e6b9074bb0371f9979097c39e011c20.sock"}
[08:09:21.881] Spawned 42926
[08:09:21.986] > local-server-2> Running ssh connection command: ssh -v -T -D 58206 -o ConnectTimeout=15 112.12.11.134
[08:09:21.987] > local-server-2> Spawned ssh, pid=42936
[08:09:21.991] stderr> OpenSSH_9.4p1, LibreSSL 3.3.6
[08:09:22.146] stderr> debug1: Server host key: ssh-ed25519 SHA256:xCYoBzFJ0C4rFLx6OE1bke8LDuAsTZzxRuTmFmCtGvI
[08:09:22.441] Got askpass request: {"request":" root@112.12.11.134's password:"}
[08:09:22.442] Showing password prompt
[08:09:22.442] Listening for interwindow password on /var/folders/td/vmtw0nr94559p36bj_z93n_w0000gn/T/vscode-ssh-askpass-256ccf1796792b767a9604e45cd4598003053a8e.sock
[08:09:22.442] Writing password prompt to globalState
[08:09:32.646] Got password response
[08:09:32.647] Interactor gave response: **************
[08:09:32.648] Cleaning up other-window auth server
[08:09:32.699] stderr> Authenticated to 112.12.11.134 ([112.12.11.134]:22) using "password".
[08:09:32.796] > Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-92-generic x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> 
>   System information as of Tue Feb  6 01:08:45 UTC 2024
> 
>   System load:  0.005859375        Users logged in:       1
>   Usage of /:   32.3% of 24.05GB   IPv4 address for eth0: 112.12.11.134
>   Memory usage: 27%                IPv4 address for eth0: 10.15.0.6
>   Swap usage:   0%                 IPv4 address for eth1: 10.104.0.3
>   Processes:    113
> 
>  * Introducing Expanded Security Maintenance for Applications.
>    Receive updates to over 25,000 software packages with your
>    Ubuntu Pro subscription. Free for personal use.
> 
>      https://ubuntu.com/pro
> 
> Expanded Security Maintenance for Applications is not enabled.
> 
> 73 updates can be applied immediately.
> To see these additional updates run: apt list --upgradable
> 
> Enable ESM Apps to receive additional future security updates.
> See https://ubuntu.com/esm or run: sudo pro status
> 
> 
> The list of available updates is more than a week old.
> To check for new updates run: sudo apt update
[08:09:32.822] > ready: 8009e4c6081b
[08:09:32.845] > Linux 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024
[08:09:32.846] Platform: linux
[08:09:32.870] > /bin/bash
[08:09:32.870] Shell: bash
[08:09:32.870] Creating bash subshell inside "bash"
[08:09:32.897] > bash version:  5.1.16(1)-release
[08:09:32.931] > 8009e4c6081b: running
[08:09:32.945] > Found existing installation at /root/.vscode-server...
> Starting VS Code CLI... "/root/.vscode-server/code-05047486b6df5eb8d44b2ecd70ea3bdf775fd937" command-shell --cli-data-dir "/root/.vscode-server/cli" --on-port --parent-process-id 509653 &> "/root/.vscode-server/.cli.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log" < /dev/null
> printenv:
[08:09:32.947] >     SHELL=/bin/bash
>     PWD=/root
>     LOGNAME=root
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=C.UTF-8
>     VSCODE_AGENT_FOLDER=/root/.vscode-server
>     SSH_CONNECTION=180.242.71.77 11204 112.12.11.134 22
>     XDG_SESSION_CLASS=user
>     USER=root
>     SHLVL=1
>     XDG_SESSION_ID=101
>     XDG_RUNTIME_DIR=/run/user/0
>     SSH_CLIENT=180.242.71.77 11204 22
>     XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     _=/usr/bin/printenv
> Removing old logfile at /root/.vscode-server/.cli.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log
[08:09:32.949] > Spawned remote CLI: 509672
[08:09:32.965] > Waiting for server log...
[08:09:33.004] > 8009e4c6081b: start
> SSH_AUTH_SOCK====
> DISPLAY====
> listeningOn==127.0.0.1:44215==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==55==
> execServerToken==aa11111a-a111-111a-1111-1a11aaa1aa11==
> 8009e4c6081b: end
[08:09:33.004] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
listeningOn==127.0.0.1:44215==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/0==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==55==
execServerToken==aa11111a-a111-111a-1111-1a11aaa1aa11==

[08:09:33.004] Remote server is listening on port 44215
[08:09:33.005] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":44215},"osReleaseId":"ubuntu","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/run/user/0","platform":"linux","execServerToken":"aa11111a-a111-111a-1111-1a11aaa1aa11"},"serverStartTime":55,"installUnpackCode":""}
[08:09:33.005] Persisting server connection details to /Users/nayr/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-1b3e6ad0-05047486b6df5eb8d44b2ecd70ea3bdf775fd937-0.108.0-es/data.json
[08:09:33.006] Starting forwarding server. local port 58213 -> socksPort 58206 -> remotePort 44215
[08:09:33.006] Forwarding server listening on port 58213
[08:09:33.006] Waiting for ssh tunnel to be ready
[08:09:33.007] Tunneled port 44215 to local port 58213
[08:09:33.007] Resolved "ssh-remote+112.12.11.134" to "port 58213"
[08:09:33.007] Resolving exec server at port 58213
[08:09:33.007] [Forwarding server port 58213] Got connection 0
[08:09:33.007] [Forwarding server port 58213] Got connection 1
[08:09:33.112] Exec server for ssh-remote+112.12.11.134 created and cached
[08:09:33.137] Verified and reusing cached exec server for ssh-remote+112.12.11.134
raraz15 commented 7 months ago

Same here

roblourens commented 7 months ago

I think this is the same issue as https://github.com/microsoft/vscode-remote-release/issues/9355

This will go away as we make useExecServer the default. You can set the setting "remote.SSH.useExecServer": true yourself, or you can try disabling the dev containers extension which is probably what starts the second prompt. cc @connor4312