I have a .NET 5 application running on a Debian server that I would like to attach a debugger to. The debugger I am trying to use is the one integrated into Visual Studio 2019.
I meet all the prerequisites listed in the documentation.
When setting up a new connection, a password connection works. However, none of my attempts with a private key result in a usable connection.
This private key works well when connecting via both PuTTY and the Windows OpenSSH binary outside of Visual Studio. Therefore, the underlying SSH tooling appears to be set up correctly.
Attempts:
Unprotected OpenSSH-compatible private key:
Results in a %LocalAppData%\devenv_exe_linux_connection_error_133651_090121.log
containing just the text Bad Data.
Also says Passphrase invalid
on the empty passphrase box
Password-protected OpenSSH-compatible private key:
Exactly the same result as the unprotected key. Bad Data.
and Passphrase invalid
.
Unprotected PuTTY-compatible private key:
Host/port textboxes report Failed to negotiate host key algorithm. Only RSA and DSA host keys are supported.
(server has ecdsa/ed25519/rsa host keys available, also the ecdsa host key was accepted by password auth)
Private key file textbox reports An error occurred connecting using private key ...
Empty passphrase textbox reports Passphrase invalid
Password-protected PuTTY-compatible private key:
Exactly the same result as the unprotected key. Failed to negotiate host key algorithm.
/ An error occurred connecting using private key
/ Passphrase invalid
.
At this point it's unclear what key format Visual Studio supports, as I have tried all the common ones.
Ideally I'd like to use the key I have stored in Pageant-compatible KeeAgent, also exposed via an OpenSSH-compatible socket. But I'll settle for getting a private key via file working.
Versions:
What worked for me connecting to a dot net core 2.1 process on Linux was this:
Conversions
menu, choose Export OpenSSH key
Then, in Visual Studio 2019:
private key
and then select the file exported above as the private key. Set the passphrase you used before.Connect
button, it should print something like "connection verified"Then in the attach to process dialog, Connection type
= SSH and select the Connection target
you just configured, it should be able to show the remote processes and let you attach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With