在/etc/ssh/ssh_config中添加远程服务器支持的cipher
如Ciphers aes128-cbc,3des-cbc,aes128-ctr
连接时指定ssh配置文件
from pexpect import pxssh client = pxssh.pxssh() clinet.loggin("host","user","pass",ssh_config="/etc/ssh/ssh_config") client.sendline('') client.logout()
https://github.com/pexpect/pexpect/blob/master/pexpect/pxssh.py