[Python] Randomly getting "Error reading SSH protocol banner" in Paramiko

Discussão em 'Python' iniciado por Stack, Agosto 13, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to transfer CSV file from one server to another using Paramiko, SSH connection.

    I never had any issues with all transfers, but for some random files, I have that:


    SSHException: Error reading SSH protocol banner
    ​

    This is strange because it happens randomly on any file, given that size of the file is almost same. Is there any way to fix it?

    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(**self.config, timeout=10, banner_timeout=60)`


    after that,

    sftp = ssh.open_sftp()
    sftp.put(local_path, remote_path)
    sftp.close()
    ssh.close()

    Continue reading...

Compartilhe esta Página