简体   繁体   中英

Remote SSH on VS Code in WSL2 password prompt

I am trying to connect to my server via SSH in VS Code for Ubuntu WSL2. However, whenever I make a connection, it is using the windows SSH instead of my Ubuntu WSL2. Is there anyway to start the remote SSH terminal in Ubuntu instead of the default Windows command prompt?

[10:14:37.201] Log Level: 2  
[10:14:37.205] remote-ssh@0.62.0  
[10:14:37.205] win32 x64  
[10:14:37.208] "remote.SSH.sshPath": /usr/bin/ssh  
[10:14:37.208] "remote.SSH.sshConfigurationFile": ~/.ssh/config  
[10:14:37.245] Checking ssh with "/usr/bin/ssh -V"
[10:14:37.251] Got error from ssh: spawn /usr/bin/ssh ENOENT  
[10:14:37.251] The specified path /usr/bin/ssh is not a valid SSH binary  
[10:14:37.252] Checking ssh with "ssh -V"  
[10:14:37.296] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5  
[10:14:37.300] Using SSH config file "~/.ssh/config"
[10:14:37.300] Running script with connection command: ssh -T -D 60054 -F "~/.ssh/config" "test-wsl" bash  
[10:14:37.303] Terminal shell path: C:\WINDOWS\System32\cmd.exe

If anyone else ran into the same problem as me, it seems that remote server in VS Code is picking up cmd as the default terminal, so I had to copy my private keys over to /mnt/c/Users/{user}/.ssh directory in order to get ssh key based authentication to work. It would be better if I could change the default shell to C:\WINDOWS\System32\bash.exe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM