microsoft / microsoft/vscode-remote-release
[Remote-SSH Bug]: Wrong user name used if it has spaces
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Is there an existing issue for this bug?
- I have searched the existing issues
Required Troubleshooting Steps
- I have followed these troubleshooting steps
- I have tried both values of the
remote.SSH.useLocalServersetting
Connect Locally
It doesn’t connect successfully (same error message)
->
No response
Expected Behavior
vscode connects successfully even if the username has spaces in it
Steps To Reproduce
- Environment is Ubuntu 24.04
.ssh/configfile content:
Host test
HostName 10.10.20.6
User "User 2"
-
ctrl+shift+p and then select
Remote-SSH: Connect to Host... -
choose the entry
test -
vscode uses the wrong username as shown below
-
ignore the wrong username displayed and write the correct password
-
select the OS
-
password prompt from step 5 reappears
Remote-SSH Log
Remote-SSH Log
[13:35:07.093] Log Level: 2
[13:35:07.098] SSH Resolver called for "ssh-remote+test", attempt 1
[13:35:07.099] "remote.SSH.useLocalServer": true
[13:35:07.099] "remote.SSH.useExecServer": true
[13:35:07.099] "remote.SSH.path": undefined
[13:35:07.099] "remote.SSH.configFile": undefined
[13:35:07.099] "remote.SSH.useFlock": true
[13:35:07.099] "remote.SSH.lockfilesInTmp": false
[13:35:07.099] "remote.SSH.localServerDownload": auto
[13:35:07.099] "remote.SSH.remoteServerListenOnSocket": false
[13:35:07.099] "remote.SSH.showLoginTerminal": true
[13:35:07.099] "remote.SSH.defaultExtensions": []
[13:35:07.099] "remote.SSH.loglevel": 2
[13:35:07.099] "remote.SSH.enableDynamicForwarding": true
[13:35:07.099] "remote.SSH.enableRemoteCommand": false
[13:35:07.099] "remote.SSH.serverPickPortsFromRange": {}
[13:35:07.099] "remote.SSH.serverInstallPath": {}
[13:35:07.103] VS Code version: 1.89.1
[13:35:07.103] Remote-SSH version: remote-ssh@0.110.1
[13:35:07.103] linux x64
[13:35:07.104] SSH Resolver called for host: test
[13:35:07.104] Setting up SSH remote "test"
[13:35:07.106] Acquiring local install lock: /tmp/vscode-remote-ssh-da70b7f7-install.lock
[13:35:07.107] Looking for existing server data file at /home/ivan/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-da70b7f7-dc96b837cf6bb4af9cd736aa3af08cf8279f7685-0.110.1-es/data.json
[13:35:07.107] Using commit id "dc96b837cf6bb4af9cd736aa3af08cf8279f7685" and quality "stable" for server
[13:35:07.108] Install and start server if needed
[13:35:07.110] PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
[13:35:07.110] Checking ssh with "ssh -V"
[13:35:07.116] > OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
[13:35:07.118] askpass server listening on /run/user/1000/vscode-ssh-askpass-b787a361b68f1cfab5b5cba26f39b47767ffa418.sock
[13:35:07.119] Spawning local server with {"serverId":1,"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-41c004466024e1c2a553ac2b30b5746d4ec3f09c.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","36995","-o","ConnectTimeout=15","test"],"serverDataFolderName":".vscode-server","dataFilePath":"/home/ivan/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-da70b7f7-dc96b837cf6bb4af9cd736aa3af08cf8279f7685-0.110.1-es/data.json"}
[13:35:07.119] Local server env: {"SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SHELL":"/bin/bash","DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/snap/code/159/usr/share/code/code","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-b787a361b68f1cfab5b5cba26f39b47767ffa418.sock"}
[13:35:07.122] Spawned 316592
[13:35:07.199] > local-server-1> Running ssh connection command: ssh -v -T -D 36995 -o ConnectTimeout=15 test
[13:35:07.202] > local-server-1> Spawned ssh, pid=316600
[13:35:07.204] stderr> OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
[13:35:08.331] stderr> debug1: Server host key: ssh-ed25519 SHA256:TUwbFsJ9Ht/RkJpfmGm4PQ8aNw0QxVcdb3MYDFWq2tw
[13:35:09.871] Got askpass request: {"request":" User 2@10.10.20.6's password:"}
[13:35:09.872] Showing password prompt
[13:35:09.872] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-171453138ce6dd3c0b5685608c6fdaa9d5347c5a.sock
[13:35:09.872] Writing password prompt to globalState
[13:35:23.031] Got password response
[13:35:23.031] Interactor gave response: ***********
[13:35:23.031] Cleaning up other-window auth server
[13:35:23.331] stderr> Authenticated to 10.10.20.6 ([10.10.20.6]:22) using "password".
[13:35:26.047] stderr> client_loop: send disconnect: Broken pipe
[13:35:26.048] > local-server-1> ssh child died, shutting down
[13:35:26.054] Local server exit: 0
[13:35:26.054] Received install output: local-server-1> Running ssh connection command: ssh -v -T -D 36995 -o ConnectTimeout=15 test
local-server-1> Spawned ssh, pid=316600
OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
debug1: Server host key: ssh-ed25519 SHA256:TUwbFsJ9Ht/RkJpfmGm4PQ8aNw0QxVcdb3MYDFWq2tw
Authenticated to 10.10.20.6 ([10.10.20.6]:22) using "password".
client_loop: send disconnect: Broken pipe
local-server-1> ssh child died, shutting down
[13:35:26.055] Error connecting, prompting to select platform. Issue related to remote-release issue #7272, temporary workaround due to OpenSSH regression.
[13:35:28.914] askpass server listening on /run/user/1000/vscode-ssh-askpass-d43fc86171daba5817fd670acb2619e57a30e946.sock
[13:35:28.914] Spawning local server with {"serverId":2,"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-d4e100f216c6cdb67216f919fac824f7830f024e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","36995","-o","ConnectTimeout=15","test","powershell"],"serverDataFolderName":".vscode-server","dataFilePath":"/home/ivan/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-da70b7f7-dc96b837cf6bb4af9cd736aa3af08cf8279f7685-0.110.1-es/data.json"}
[13:35:28.914] Local server env: {"SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SHELL":"/bin/bash","DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/snap/code/159/usr/share/code/code","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-d43fc86171daba5817fd670acb2619e57a30e946.sock"}
[13:35:28.918] Spawned 316835
[13:35:28.992] > local-server-2> Running ssh connection command: ssh -v -T -D 36995 -o ConnectTimeout=15 test powershell
[13:35:28.995] > local-server-2> Spawned ssh, pid=316843
[13:35:28.997] stderr> OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
[13:35:30.115] stderr> debug1: Server host key: ssh-ed25519 SHA256:TUwbFsJ9Ht/RkJpfmGm4PQ8aNw0QxVcdb3MYDFWq2tw
[13:35:31.653] Got askpass request: {"request":" User 2@10.10.20.6's password:"}
[13:35:31.653] Showing password prompt
[13:35:31.653] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-6771b835e990f7006bf63ca61052b27e708c0a26.sock
[13:35:31.654] Writing password prompt to globalState
[13:35:34.520] Password dialog canceled
[13:35:34.520] Interactor signaled cancel
[13:35:34.520] Cleaning up other-window auth server
[13:35:34.816] stderr> Permission denied, please try again.
[13:35:34.892] Got askpass request: {"request":" User 2@10.10.20.6's password:"}
[13:35:35.187] stderr> Permission denied, please try again.
[13:35:35.263] Got askpass request: {"request":" User 2@10.10.20.6's password:"}
[13:35:35.567] stderr> User 2@10.10.20.6: Permission denied (publickey,password,keyboard-interactive).
[13:35:35.569] > local-server-2> ssh child died, shutting down
[13:35:35.575] Local server exit: 0
[13:35:35.575] Received install output: local-server-2> Running ssh connection command: ssh -v -T -D 36995 -o ConnectTimeout=15 test powershell
local-server-2> Spawned ssh, pid=316843
OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
debug1: Server host key: ssh-ed25519 SHA256:TUwbFsJ9Ht/RkJpfmGm4PQ8aNw0QxVcdb3MYDFWq2tw
Permission denied, please try again.
Permission denied, please try again.
User 2@10.10.20.6: Permission denied (publickey,password,keyboard-interactive).
local-server-2> ssh child died, shutting down
[13:35:35.576] Resolver error: Error: Permission denied (publickey,password,keyboard-interactive).
at g.Create (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:499181)
at /home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:495789
at t.handleInstallOutput (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:496425)
at e (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:557639)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async e (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:558380)
at async /home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:579548
at async t.withShowDetailsEvent (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:583207)
at async /home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:554344
at async T (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:552395)
at async t.resolveWithLocalServer (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:553884)
at async k (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:576765)
at async t.resolve (/home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:580578)
at async /home/ivan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.110.1/out/extension.js:2:846687
[13:35:35.578] ------
Anything else?
this is the same bug as #3560 but the issue still persist for me
i can successfully connect to the remote machine with this command: ssh test
openssh version: OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the connection with the provided .ssh/config entry for test and compare it with the successful ssh test command. Trace the Remote-SSH connection flow around the username and password prompts; done means a username containing spaces is preserved and the remote connection completes successfully.
Written by the indexing model from the issue text.
Assessment
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100