问题
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