Skip to main content
added 7 characters in body
Source Link
FalcoGer
  • 255
  • 2
  • 15

I wish to connect visual studio (2022) to my laptop for cross compilation of c++ projects. I am having an issue however. It doesn't accept the connection.

I have read on another question, that visual studio accepts rsa keys only in PEM format, so I generated the key in that format using ssh-keygen -m PEM -t rsa -b 4096. I have tried with, and without pem format all kinds of different key sizes (1024, 2048, 4096, 8192) with and without passphrases. I have tested each one of those keys by adding the public key to my authorized keys file on my ubuntu laptop and connection from WSL2 using the generated key (ssh -i <key_file> user@host). It worked every time.

I have also read on this question that you should generate the key using puttygen and then exporting the openssh key. I tried that also, with and without passphrases, though only with the default key size. Again connecting from the bash terminal from WSL2 works fine using those keys, but I can't connect in MSVS.

The error messages from visual studio's connection manager make no sense either. When I click connect, it asks me to confirm the fingerprint of the host, and to add it to the known hosts file. When I click yes, the input fields for the connection manager turn red. Hovering over the red fields yiels the results:

For "Host name:" as well as "Port:"

Failed to negotiate host key algorithm. Only RSA and DSA host keys are supported.

I'm not quite sure what that means. My host has an rsa key file formats in their home/.ssh directory. Visual studio says when first connecting that the key fingerprint is "ecdsa-sha2-nistp256", which is supported according to the documentation.

For "Private key file:"

An error occurred connecting using private key '<path to key>'.

When using a key with an empty keypassphrase before, the passphrase was also marked red, now that indication is gone.

What needs to be done to make it work?

enter image description here

I wish to connect visual studio (2022) to my laptop for cross compilation of c++ projects. I am having an issue however. It doesn't accept the connection.

I have read on another question, that visual studio accepts rsa keys only in PEM format, so I generated the key in that format using ssh-keygen -m PEM -t rsa -b 4096. I have tried with, and without pem format all kinds of different key sizes (1024, 2048, 4096, 8192) with and without passphrases. I have tested each one of those keys by adding the public key to my authorized keys file on my ubuntu laptop and connection from WSL2 using the generated key (ssh -i <key_file> user@host). It worked every time.

I have also read on this question that you should generate the key using puttygen and then exporting the openssh key. I tried that also, with and without passphrases, though only with the default key size. Again connecting from the bash terminal from WSL2 works fine using those keys, but I can't connect in MSVS.

The error messages from visual studio's connection manager make no sense either. When I click connect, it asks me to confirm the fingerprint of the host, and to add it to the known hosts file. When I click yes, the input fields for the connection manager turn red. Hovering over the red fields yiels the results:

For "Host name:" as well as "Port:"

Failed to negotiate host key algorithm. Only RSA and DSA host keys are supported.

I'm not quite sure what that means. My host has an rsa key file formats in their home/.ssh directory. Visual studio says when first connecting that the key fingerprint is "ecdsa-sha2-nistp256", which is supported according to the documentation.

For "Private key file:"

An error occurred connecting using private key '<path to key>'.

When using a key with an empty key before, the passphrase was also marked red, now that indication is gone.

What needs to be done to make it work?

enter image description here

I wish to connect visual studio (2022) to my laptop for cross compilation of c++ projects. I am having an issue however. It doesn't accept the connection.

I have read on another question, that visual studio accepts rsa keys only in PEM format, so I generated the key in that format using ssh-keygen -m PEM -t rsa -b 4096. I have tried with, and without pem format all kinds of different key sizes (1024, 2048, 4096, 8192) with and without passphrases. I have tested each one of those keys by adding the public key to my authorized keys file on my ubuntu laptop and connection from WSL2 using the generated key (ssh -i <key_file> user@host). It worked every time.

I have also read on this question that you should generate the key using puttygen and then exporting the openssh key. I tried that also, with and without passphrases, though only with the default key size. Again connecting from the bash terminal from WSL2 works fine using those keys, but I can't connect in MSVS.

The error messages from visual studio's connection manager make no sense either. When I click connect, it asks me to confirm the fingerprint of the host, and to add it to the known hosts file. When I click yes, the input fields for the connection manager turn red. Hovering over the red fields yiels the results:

For "Host name:" as well as "Port:"

Failed to negotiate host key algorithm. Only RSA and DSA host keys are supported.

I'm not quite sure what that means. My host has an rsa key file formats in their home/.ssh directory. Visual studio says when first connecting that the key fingerprint is "ecdsa-sha2-nistp256", which is supported according to the documentation.

For "Private key file:"

An error occurred connecting using private key '<path to key>'.

When using a key with an empty passphrase before, the passphrase was also marked red, now that indication is gone.

What needs to be done to make it work?

enter image description here

Source Link
FalcoGer
  • 255
  • 2
  • 15

Visual Studio Connection Manager doesn't accept private key

I wish to connect visual studio (2022) to my laptop for cross compilation of c++ projects. I am having an issue however. It doesn't accept the connection.

I have read on another question, that visual studio accepts rsa keys only in PEM format, so I generated the key in that format using ssh-keygen -m PEM -t rsa -b 4096. I have tried with, and without pem format all kinds of different key sizes (1024, 2048, 4096, 8192) with and without passphrases. I have tested each one of those keys by adding the public key to my authorized keys file on my ubuntu laptop and connection from WSL2 using the generated key (ssh -i <key_file> user@host). It worked every time.

I have also read on this question that you should generate the key using puttygen and then exporting the openssh key. I tried that also, with and without passphrases, though only with the default key size. Again connecting from the bash terminal from WSL2 works fine using those keys, but I can't connect in MSVS.

The error messages from visual studio's connection manager make no sense either. When I click connect, it asks me to confirm the fingerprint of the host, and to add it to the known hosts file. When I click yes, the input fields for the connection manager turn red. Hovering over the red fields yiels the results:

For "Host name:" as well as "Port:"

Failed to negotiate host key algorithm. Only RSA and DSA host keys are supported.

I'm not quite sure what that means. My host has an rsa key file formats in their home/.ssh directory. Visual studio says when first connecting that the key fingerprint is "ecdsa-sha2-nistp256", which is supported according to the documentation.

For "Private key file:"

An error occurred connecting using private key '<path to key>'.

When using a key with an empty key before, the passphrase was also marked red, now that indication is gone.

What needs to be done to make it work?

enter image description here