SyncMaster
SyncMaster

Reputation: 9936

Handling Paramiko SSHException - Server connection dropped

I am trying to copy files from remote server to my local directory.

I am using Python paramiko's sftp get to copy the files.

sftp.get(remote_pate, local_path)

After copying very few files, I get the following exception.

SSHException('Server connection dropped')

Establishing connection using,

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username=username, password=password)
sftp = ssh.open_sftp()

Why does the connection get dropped? How can I handle this? Thanks in advance.

Upvotes: 4

Views: 7614

Answers (1)

GodMan
GodMan

Reputation: 2641

This would arise (as mentioned in the source, line no 667, http://www.lag.net/paramiko/docs/paramiko.sftp_client-pysrc.html) when there is any error reading the packet or when there is EOFError

Upvotes: 2

Related Questions