“收到的消息太长"使用 Ant/JSch 连接到 SFTP 服务器时 [英] "Received message is too long" when connecting using Ant/JSch to SFTP server

查看:45
本文介绍了“收到的消息太长"使用 Ant/JSch 连接到 SFTP 服务器时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件从我的本地 unix 机器上传到支持 SFTP 的远程服务器.我尝试使用 Ant 脚本来实现,该脚本使用 sftp 属性设置为 true 的 SCP 任务,但它不起作用,因为它总是会出错:

I would like to upload a file from my local unix machine to a remote server that supports SFTP. I tried to implement using Ant script that used SCP task with sftp attribute set to true, but it didn't work, since it would always error out:

com.jcraft.jsch.JSchException:4:收到的消息太长:1416128878.

com.jcraft.jsch.JSchException: 4: Received message is too long: 1416128878.

如果你能帮助我使用 shell 脚本来解决这个问题.我还必须在本地机器上安装 sftp 或其他东西,以便脚本正常工作吗?

If you can help me achieve that using shell script that should resolve the issue. Also will I have to install sftp or something on my local machine so that the script works?

这里的任何帮助将不胜感激.

Any help here would be greatly appreciated.

干杯,
阿什利

推荐答案

您的 Ant 脚本有效.是服务器不工作.

Your Ant script works. It's the server that does not work.

服务器打印了一些消息,因此违反了 SFTP 协议.如果您尝试过任何独立的 SFTP 客户端,您会发现无法连接.

The server prints some message, thus violates SFTP protocol. Had you tried any standalone SFTP client, you will see that you are not able to connect.

消息以Thin开头(0x 54 68 69 6E = 1416128878).

The message starts Thin (0x ‭54 68 69 6E = ‭1416128878‬).

另见https://winscp.net/eng/docs/message_large_packet

这篇关于“收到的消息太长"使用 Ant/JSch 连接到 SFTP 服务器时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆