JSch SCP file transfer using “exec” channel

前端 未结 1 397
庸人自扰
庸人自扰 2020-12-19 23:27

I\'m very new to the SCP protocol and JSch. I have to transfer a file fro a remote device via SCP to Android. The server side developers refused to tell be anything about th

相关标签:
1条回答
  • 2020-12-20 00:21

    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.

    0 讨论(0)
提交回复
热议问题