Force password authentication (ignore keys in .ssh folder) in Paramiko in Python

两盒软妹~` 提交于 2019-12-06 08:50:17

The SSHClient.connect method has look_for_keys argument. Set it to False:

client.connect(
    'ssh.example.com', username='strongbad', password='thecheat', look_for_keys=False)

Similarly you may want to set allow_agent to False as well.


Obligatory warning: Do not use AutoAddPolicy, unless you do not care about security. You are losing a protection against MITM attacks this way.
For a correct solution, see Paramiko "Unknown Server".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!