JSch SCP file transfer using “exec” channel

[亡魂溺海] 提交于 2019-11-29 11:56:55
Martin Prikryl

If the device supports SCP only, do not try to use SFTP, use SCP.

There's an official example for implementing the SCP download using the JSch:
http://www.jcraft.com/jsch/examples/ScpFrom.java.html


Do not get confused by the call of scp in the example code. That's how SCP protocol works. A local (OpenSSH) scp executes the scp on the remote server (with specific non-public arguments, in this case the -f) and then the two instances talk to each other. The example implements the local scp. The arguments used for the remote scp are not the arguments you would use for the local scp.

See also Explanation for SCP protocol implementation in JSch library.

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