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
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.