python sftp连接报异常接受到垃圾包_python – Paramiko引发“SFTPError:垃圾包收到”...

以下代码:

t = paramiko.Transport((hostname, port))

t.connect(username=username, password=password)

sftp = t.open_sftp_client()

引发此异常:

Traceback (most recent call last):

File "C:\Users\elqstux\workspace\WxPython\FetcchFile.py", line 41, in

sftp = t.open_sftp_client()

File "C:\Python27\lib\site-packages\paramiko\transport.py", line 845, in open_sftp_client

return SFTPClient.from_transport(self)

File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 106, in from_transport

return cls(chan)

File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 87, in __init__

server_version = self._send_version()

File "C:\Python27\lib\site-packages\paramiko\sftp.py", line 108, in _send_version

t, data = self._read_packet()

File "C:\Python27\lib\site-packages\paramiko\sftp.py", line 179, in _read_packet

raise SFTPError('Garbage packet received')

SFTPError: Garbage packet received

我的主机的IP是147.214.16.150,我使用这个命令在控制台中测试:

esekilvxen245 [11:03am] [/home/elqstux] -> sftp 147.214.16.150

Connecting to 147.214.16.150...

These computer resources, specifically Internet access and E-mail, are

provided for authorized users only. For legal, security and cost

reasons, utilization and access of resources are monitored and recorded

in log files. All information (whether business or personal) that is

created, received, downloaded, stored, sent or otherwise processed can

be accessed, reviewed, copied, recorded or deleted by Ericsson, in

accordance with approved internal procedures, at any time if deemed

necessary or appropriate, and without advance notice. Any evidence of

unauthorized access or misuse of Ericsson resources may result in

disciplinary actions, including termination of employment or assignment,

and could subject a user to criminal prosecution. Your use of Ericsson's

computer resources constitutes your consent to Ericsson's Policies and

Directives, including the provisions stated above.

IF YOU ARE NOT AN AUTHORIZED USER, PLEASE EXIT IMMEDIATELY

Enter Windows Password:

Received message too long 1131770482

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值