Paramiko Error: Error reading SSH protocol banner
Solution 1
This issue didn't lie with Paramiko, Fabric or the SSH daemon. It was simply a firewall configuration in ISPs internal network. For some reason, they don't allow communication between different subnets of theirs.
We couldn't really fix the firewall configuration so instead we switched all our IPs to be on the same subnet.
Solution 2
Try changing the banner timeout from 15 seconds to 30 secs in the transport.py file. Also, it could be that the sshd daemon on the server is hung. Can you SSH into it manually?
Mridang Agarwalla
I'm a software developer who relishes authoring Java and Python, hacking on Android and toying with AppEngine. I have a penchant for development and a passion for the business side of software. In between all the work, I contribute to a number of open-source projects, learn to master the art of cooking Asian cuisine and try to stay sane while learning to fly my Align Trex-600 Nitro Heli.
Updated on August 31, 2020Comments
-
Mridang Agarwalla over 3 years
I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different but everytime I run my Fabric script I get the error
Error reading SSH protocol banner
. This script is connecting with the same user on both servers. The script works fine on all other servers except this new one that I just clones. The only thing that is radically different is the IP address which is totally different range.Any ideas on what could be causing this?
-
Mridang Agarwalla over 12 yearsI edited transport.py and changed the timeout to 30 seconds but it didn't help. I can SSH to the server manually and execute all the commands. Weird issue.
-
Mridang Agarwalla over 12 yearsI just ran a traceroute from my Fabric server to the Server A and Server B. The traceroute of Server A went just fine and the script works just fine too but the traceroute of Server B showed me 28 of these unknown host things
* * *
. The IPs of both servers belong to same ISP the only thing different is the class. -
Cerin over 11 yearsThanks, this fixed the problem in my case.
-
sagar over 10 yearsI am geting same error. but In my case host is amazon instance what should I do in that case
-
VKen over 9 yearsThanks, this fixed by problem too.
-
törzsmókus over 6 yearsyou can change the parameter without editing transport.py:
transport.banner_timeout = 300