SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

SSH Key fails on RHEL/Alma/Rocky Linux 9 #375

Closed cshabazian closed 1 year ago

cshabazian commented 1 year ago

I have setup a number of ssh connections using an SSH Hop proxy connection.

When end point is a R/A/R 8 box, everything works fine using my private key.

When end point is a R/A/R 9 box, the private key fails and I get an error on the server in /var/log/secure saying: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] but this exact same key works to connect to the exact same server using MobaXterm, so it's NOT the key. If I connect using a password, it works just fine, so I know the connection is configured properly, but it's doing something funny with the key ONLY when going to a R/A/R 9 server.

SchoofsKelvin commented 1 year ago

Which version of OpenSSH does R/A/R 9 use versus 8? In #309 someone had a similar issue due to OpenSSH deprecating ssh-rsa keys. You'd either have to manually allow it again (it's not removed from OpenSSH, just disabled by default) or possibly re-export the existing key as a different type. A quick search gives me this article which explains it well (before going in-depth into a related issue).

I imagine MobaXterm automatically converts ssh-rsa keys to a format the server accepts when necessary, I think I've read that the latest PuTTY versions do something similar. The underlying SSH library the extension uses (ssh2) doesn't support that yet, which is already known (mscdex/ssh2#989) for a long while. I might try to patch it from my side but that might get tricky.

SchoofsKelvin commented 1 year ago

I assume this is indeed caused by upgrading OpenSSH. Since this is then technically a duplicate of #309, I've updated that issue (with a new comment) and I'll close this one.