Providing input/subcommands to command executed over SSH with JSch

Calling ChannelExec.setCommand multiple times has no effect. And even if it had, I’d guess that the 192.168.50.1 : and Config.txt are not commands, but inputs to the copy run tftp : command, aren’t they? If that’s the case, you need to write them to the command input. Something like this: ChannelExec channel = (ChannelExec) session.openChannel(“exec”); … Read more