当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - How can we programmatically use a DSA key to connect to an SFTP server?

问题描述:

Has anyone at SO been able to connect to an SFTP server using DSA or RSA (using any free library)?

I've tried SharpSSH, and I can see some references to DSA in the code. However, I can't seem to find any methods that allow me to specify the DSA key to use to connect. I tried searching for the documentation for this library, but I could only find the distributable.

I hope someone here would have used SharpSSH, and could advise me how to pass a key instead of a password or would know where I could find the documentation for this library.

Alternatively, a solution with any other free library would also be appreciated.

Thanks in advance.

网友答案:

You need to use the addIdentityFile method, and pass the path to the private key.

分享给朋友:
您可能感兴趣的文章:
随机阅读: