[Solved] paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Recently, SFTP upload and download should be configured in the project. After the environment is configured, the connection will report an error.

The error information is as follows:

paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Solution 1:

Set banner_ Timeout property value

You can change the transport.py under the paramiko Library in the site packages source file. The transport code is as follows:

 class Transport(threading.Thread, ClosingContextManager):
        self.banner_timeout = 15
        # how long (seconds) to wait for the handshake to finish after SSH

15 can be changed to 30

Solution 2:

Pay attention to check your host, port, username, password and other information, as well as upload or download directory path!


Read More: