获取paramiko.ssh_exception.SSHException:读取SSH协议标语由于连接错误(Python)

时间:2019-03-21 12:46:51

标签: python windows console remote-access fabric

Python 3.7 面料2.4.0 无法连接远程电脑 如果我尝试使用其他端口,请使用端口3389(如mstsc)-获取“无法连接到端口”

v = Connection(host=ServName, port=Port, user=User, connect_kwargs={'password': 's3cr3t'})
print(v.is_connected) #get False
v.run('dir') #get error (see img attach below)

Image of the error

1 个答案:

答案 0 :(得分:0)

端口3389通常用于Windows RDP,而不用于ssh。您可能正在尝试通过WinRM(通常是端口5985-86)进行连接,在这种情况下,请使用pywinrm library,而不要使用Fabric。最好使用可连​​接此功能的ansible。