ssh.net

“Renci.SshNet.Common.SshException: Invalid private key file” when loading SSH private key from configuration string using SSH.NET

百般思念 提交于 2020-12-01 09:35:20
问题 I'm trying to send a file to some server using SFTP. During this process I'm getting the exception Renci.SshNet.Common.SshException: Invalid private key file. at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase) Generated the keys using PuTTYgen, shown below is an sample format of private key file. It has both the public and the private keys. PuTTY-User-Key-File-2: ssh-rsa Encryption:none comment: rsa-key-20190327 Public-Lines: 4 AAAAB..... ...... Private-Lines: 8 AAAAgQ.