“接收到的消息太长".使用Ant/JSch连接到SFTP服务器时 [英] "Received message is too long" when connecting using Ant/JSch to SFTP server
问题描述
我想将文件从我的本地UNIX计算机上载到支持SFTP的远程服务器上.我尝试使用Ant脚本实现该脚本,该脚本使用了SCP任务,并且sftp
属性设置为true,但是它没有用,因为它总是会出错:
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.
干杯,
阿什利
Cheers,
Ashley
推荐答案
您的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屋!