使用私钥连接到服务器时,pysftp AuthenticationException

异教徒

我正在尝试连接到SFTP服务器。我有一个私钥和一个密码。我尝试阅读有关SO的相关问题,但无法成功连接。

这是我尝试过的:

pysftp.Connection(host=<hostname>, username=<username>,
                  password=<password>, private_key=<path to .ppk file>)

AuthenticationException:验证失败

pysftp.Connection(host=<hostname>, username=<username>,
                  private_key_pass=<password>, private_key=<path to .ppk file>) 

SSHException:不是有效的DSA私钥文件

但是,我可以使用相同的凭据并与FileZilla连接。FileZilla要求输入密码,然后将该.ppk文件转换为不受保护的文件。

我试图使用与FileZilla中相同的主机名,用户名和密钥文件,但我仍然遇到错误。还尝试使用Paramiko连接。

异教徒

我终于可以连接了。

.pem使用PuTTY将文件转换为文件传递了此.pem文件,并使其余参数与以前相同。

pysftp.Connection(host='hostname', username='username',
                   password='password', private_key='path to .pem file')

希望这对遇到类似问题的人有所帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

AuthenticationException使用正确的凭据抛出

使用纯Java的AuthenticationException LDAP

尝试使用Java驱动程序连接到Cassandra时出现AuthenticationException

AuthenticationException: 无效的凭据!在 Hazelcast 中使用正确的凭据时

当一个节点关闭时,Cassandra AuthenticationException

WinError 10060尝试使用Python PySFTP模块连接到远程服务器时出错

使用pysftp连接到SFTP服务器时出现“无法加载HostKeys”警告

不使用 RSA 私钥文件连接到服务器

当在Kerberos中抛出AuthenticationException时,IE中的无限重定向循环

使用自定义身份验证处理Spring 5中的AuthenticationException

如何让 WinSCP 使用我指定的私钥连接到 SSH 服务器?

无法使用Nautilus和私钥连接到远程服务器

如何使用SSH和PowerShell中的私钥连接到Linux服务器?

使用LXD REST API,ClientWebSocket在.Net Core上引发“ AuthenticationException”,但在.Net Framework上,它运行良好

Hazelcast客户端的AuthenticationException

证书的iOS推送通知AuthenticationException

使用IDE连接到Openshift服务器时出错

使用xmppFramework连接到服务器时卡住

如何在连接多台服务器时使用公共私钥?

使用 volley 连接到 android 中的服务器时出现内部服务器错误?

使用节点js中的私钥连接ssh服务器

尝试连接到蓝牙服务器时连接被拒绝

尝试连接到服务器时,Sshutle连接被拒绝

Mongodb:首次连接时无法连接到服务器

连接到NodeJS https服务器时重置连接

Mongo在首次连接时无法连接到服务器

连接到 Web 服务器时连接被拒绝

AuthenticationException Neo4j Spark流

Laravel 5.3 Unauthorized()AuthenticationException致命错误