旧的 SFTP 问题:paramiko.ssh_exception.SSHException:不兼容的 ssh 对等点(没有可接受的主机密钥)

问题描述 投票:0回答:1

错误:paramiko.ssh_exception.SSHException:不兼容的 ssh 对等点(没有可接受的主机密钥)

Paramiko 版本:2.8.1 [不幸无法更新]

调试日志:

DEBUG:paramiko.transport:starting thread (client mode): 0x28252fd0
DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.8.1
DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-AWS_SFTP_1.1
INFO:paramiko.transport:Connected (version 2.0, client AWS_SFTP_1.1)
DEBUG:paramiko.transport:kex algos:['[email protected]', '[email protected]', '[email protected]', '[email protected]', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'curve25519-sha256', '[email protected]', 'diffie-hellman-group18-sha512', 'diffie-hellman-group16-sha512', 'diffie-hellman-group-exchange-sha256'] server key:['rsa-sha2-512', 'rsa-sha2-256'] client encrypt:['[email protected]', '[email protected]', 'aes128-ctr', 'aes256-ctr', 'aes192-ctr'] server encrypt:['[email protected]', '[email protected]', 'aes128-ctr', 'aes256-ctr', 'aes192-ctr'] client mac:['[email protected]', '[email protected]'] server mac:['[email protected]', '[email protected]'] client compress:['none', '[email protected]'] server compress:['none', '[email protected]'] client lang:[''] server lang:[''] kex follows?False
DEBUG:paramiko.transport:Kex agreed: [email protected]
ERROR:paramiko.transport:Exception: Incompatible ssh peer (no acceptable host key)

获取私钥使用:

pkey = Ed25519Key.from_private_key(io.StringIO(private_key_ascii))

自从

pkey = RSAKey.from_private_key(io.StringIO(private_key_ascii))

没有工作。

python ssh sftp paramiko
1个回答
0
投票

好吧,你必须升级。

您的服务器只有 rsa-sha2 主机密钥:

server key:['rsa-sha2-512', 'rsa-sha2-256'] 

Paramiko 仅支持 2.9.0 以后的版本:
https://www.paramiko.org/changelog.html#2.9.0

© www.soinside.com 2019 - 2024. All rights reserved.