天天看点

vs2019 使用私钥进行连接时出错 ssh连接报错

通过vs进行远程连接开发时,遇到一个ssh私钥连接不成功的问题。我的私钥时通过ssh-keygen命令生成的默认密钥。该密钥格式为默认的openssh。

但是根据微软的官方文档,vs2019目前仅支持RSA和DSA密钥用于远程连接

因此遇到此问题,可在生成私钥时选择rsa

#生成
ssh-keygen -t rsa
#转换
#https://stackoverflow.com/questions/54994641/openssh-private-key-to-rsa-private-key
ssh-keygen -p -P "old passphrase" -N "new passphrase" -m pem -f path/to/key
           

或者使用Puttygen工具进行转换,首先通过Conversions-Import Key加载私钥,再通过Export OpenSSH Key导出RSA格式的私钥。

转载请注明出处: cnblogs.com/wswind

VS

继续阅读