“Received message is too long” when connecting using Ant/JSch to SFTP server

与世无争的帅哥 提交于 2019-12-08 06:52:45

问题


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: Received message is too long: 1416128878.

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


回答1:


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

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.

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

See also https://winscp.net/eng/docs/message_large_packet



来源:https://stackoverflow.com/questions/38897135/received-message-is-too-long-when-connecting-using-ant-jsch-to-sftp-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!