python-使用paramiko进行缓慢的公钥身份验证
作者:互联网
我正在使用paramiko通过ssh连接到远程服务器.使用公共密钥进行身份验证时,性能会很慢(约90秒).这是相关的日志记录输出:
2012-05-14 17:37:21,378 Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
2012-05-14 17:37:21,378 using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
2012-05-14 17:37:21,481 Switch to new keys ...
2012-05-14 17:37:21,483 Adding ssh-rsa host key for 10.12.34.56: 8a05c68a0707a9fad19290c22542a338
2012-05-14 17:37:21,485 Trying discovered key 3793c7b9c500f52c12e190e92e21713f in /home/david/.ssh/id_rsa
2012-05-14 17:37:21,513 userauth is OK
2012-05-14 17:38:54,370 Authentication (publickey) successful!
注意日志输出的最后两行之间的延迟.当使用ssh从命令行为同一用户和远程服务器连接时,连接是瞬时的.有什么想法造成延迟吗?
解决方法:
pycrypto> = 2.5非常慢.降级为pycrypto == 2.4.1后,我看到了25倍的改进.
标签:ssh-keys,python,paramiko 来源: https://codeday.me/bug/20191201/2079996.html