SFTPError: Garbage packet received
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
paramiko |
New
|
Undecided
|
Unassigned |
Bug Description
When I'm trying to upload data using SFTPClient, I almost always immediately get the following error:
File "/home/
self.
File "/usr/lib/
t, msg = self._request(
File "/usr/lib/
return self._read_
File "/usr/lib/
t, data = self._read_packet()
File "/usr/lib/
raise SFTPError('Garbage packet received')
I am able to transfer the files without problems when using scp, sshfs or sftp. Normal ssh access works fine too. Only Paramiko seems to fail.
This happens on at least two systems:
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.1p1 Debian-5ubuntu1 pat OpenSSH*
and
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH_3.*
I am using Paramiko 1.7.6-2 (Ubuntu Lucid).
I see the same thing, but only under certain circumstances. Connecting to
Authenticating with a password works fine:
>>> transport = paramiko. Transport( (host, port)) remote_ version 0-OpenSSH_ 4.3p2 Debian- 5~bpo.1. netgear1' auth_password( username= user, password=passwd) open_sftp_ client( )
>>> transport.connect()
>>> transport.
'SSH-2.
>>> transport.
[]
>>> sftp = transport.
Success. Working sftp client.
Authenticating with a public key fails:
>>> transport = paramiko. Transport( (host, port)) auth_publickey( username= user, key=keys[0]) authenticated open_sftp_ client( ) lib\site- packages\ paramiko- 1.7.4-py2. 7.egg\paramiko\ transport. py", line 809, in open_sftp_client from_transport( self) lib\site- packages\ paramiko- 1.7.4-py2. 7.egg\paramiko\ sftp_client. py", line 105, in from_transport lib\site- packages\ paramiko- 1.7.4-py2. 7.egg\paramiko\ sftp_client. py", line 86, in __init__ version( ) lib\site- packages\ paramiko- 1.7.4-py2. 7.egg\paramiko\ sftp.py" , line 108, in _send_version lib\site- packages\ paramiko- 1.7.4-py2. 7.egg\paramiko\ sftp.py" , line 179, in _read_packet
>>> transport.connect()
>>> transport.
[]
>>> transport.
True
>>> sftp = transport.
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\
return SFTPClient.
File "C:\Python27\
return cls(chan)
File "C:\Python27\
server_version = self._send_
File "C:\Python27\
t, data = self._read_packet()
File "C:\Python27\
raise SFTPError('Garbage packet received')
SFTPError: Garbage packet received
>>>
This error is 100% reproducible on this system (every time I authenticate with password, creating an sftp client succeeds, and every time I authenticate with a public key, creating an sftp client fails). I can sftp successfully using public key authentication with other sftp clients, including Putty and Bitvise Tunnelier.