1

getting this strange popup error on selecting ssh key using remote-ssh vs code extension no remote connections have been successful since this error has began

checked out my log file but didnt get much more information than the popup gave seems out of place for vs code to do this window popup instead of the notif in the bottom right

i've made efforts into searching this text on SE and google to no luck if nothing else i'd rather remove VScode entirely from my pc and start from scratch

2022-12-08 00:43:12.981 [info] Extension host with pid 388 started
2022-12-08 00:43:13.044 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2022-12-08 00:43:13.063 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2022-12-08 00:43:13.073 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2022-12-08 00:43:13.091 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2022-12-08 00:43:13.114 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2022-12-08 00:43:13.141 [info] Eager extensions activated
2022-12-08 00:43:13.143 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.146 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.151 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.159 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.167 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.193 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:46.716 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-ssh, startup: false, activationEvent: 'onCommand:opensshremotes.openEmptyWindow'
2022-12-08 00:44:09.327 [error] Error: EINVAL: invalid argument, mkdir 'C:\Users\*username*\AppData\Local\Programs\Microsoft VS Code\"C:' opensshremotes.addNewSshHost {"value":"ms-vscode-remote.remote-ssh","c":"ms-vscode-remote.remote-ssh"}
2022-12-08 00:44:09.328 [error] Error: EINVAL: invalid argument, mkdir 'C:\Users\*username*\AppData\Local\Programs\Microsoft VS Code\"C:' opensshremotes.openEmptyWindow {"value":"ms-vscode-remote.remote-ssh","c":"ms-vscode-remote.remote-ssh"}

this is the persistent error in question on a clean window from the exthost.log, omitted my username

running Windows 11 Home build 22621.819

i've tried looking up solutions on SE and google and come up empty handed every time.

cmdlanes
  • 11
  • 1

1 Answers1

0

I can't help you with the error since it doesn't tell enough but I'll share with you my setup which you can try.

On your local computer from which you establish SSH to remote PC create a new config file (without extension) in your C:\Users\User\.ssh directory

Following are the contents of the file which you must update according to comments:

# This is the ssh client configuration sample file
# File syntax info: https://man7.org/linux/man-pages/man5/ssh_config.5.html

# Connection name as it will be displayed in Remote Explorer
Host Remote_SSH

    # Specifies the real host name to log into.
    HostName REMOTE_COMPUTER_NAME

    # User name to which to log on on remote host
    User RemoteAdminName

    # Specifies the protocol versions in order of preference.
    # The possible values are '1' and '2'.
    # protocol version 1 is NOT RECOMMENDED for security reasons.
    Protocol 2

    # Specifies which address family to use when connecting.
    # Valid arguments are: any, inet, inet6.
    AddressFamily inet

    # Specifies the ciphers allowed for protocol version 2 in order of preference.
    # Multiple ciphers must be comma-separated.
    # Run: "ssh -Q cipher" to see available chipers
    Ciphers aes256-cbc,aes256-ctr

    # Specifies a file from which the user's identity key is read when using public key authentication.
    # This should be public key
    IdentityFile ~\\.ssh\\YOUR_PUBLIC_SSH_KEY.pub

Next step is to copy your public SSH key to remote computer into the following location:

C:\Users\REMOTE_ADMIN_NAME\.ssh\authorized_keys

Where authorized_keys is not a directory but rather a file with no extension that contains your public SSH key. (simply rename your copied key to authorized_keys on remote PC.

For more information see:

https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication

Remote computer must have VSCode installed.

Once you update relevant parameters in local config file and set up SSH key on remote computer open up VSCode and click on Remote-Explorer in action bar (side bar)

Click on little + sign when you hover over SSH node as shown in the image below:

enter image description here

Then into the box that appears type the ssh command ex. ssh Admin@REMOTE_PC

This will show you the list to choose your config that you previously created, select it from the list.

Then you should be prompted to connect to remote host.

metablaster
  • 1,958
  • 12
  • 26