I am using .53 version with Java 8 on Solarwinds free SFTP server(http://www.solarwinds.com/free-tools/free-sftp-server/). Trying to do channel connect to the box.
When I'm using channel.connect() method without timeOut value, I'm able to connect to server successfully. But when timeOut is placed as value to the channel.connect(timeOut), then I'm getting "failed to send channel request" error message. Here I used timeOut = 60000
The exception I am getting:
com.jcraft.jsch.JSchException: failed to send channel request
at com.jcraft.jsch.Request.write(Request.java:65)
at com.jcraft.jsch.RequestShell.request(RequestShell.java:49)
at com.jcraft.jsch.ChannelShell.start(ChannelShell.java:47)
at com.jcraft.jsch.Channel.connect(Channel.java:152)
Here is my code:
Session session = null;
Channel channel = null;
JSch jsch = new JSch();
Properties jschProps = new Properties();
jschProps.put("cipher.s2c", ciphers);
jschProps.put("cipher.c2s", ciphers);
jschProps.put("kex", "ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1");
jschProps.put("StrictHostKeyChecking", "no");
session = jsch.getSession(username, host, port);
session.setPassword(password);
session.setTimeout(timeOut);
session.setConfig(jschProps);
session.connect(timeOut);
channel = session.openChannel("shell");
// remove the 'timeout' value for channel connect method for successful connection.
channel.connect(timeOut);
//channel.connect();
Exception is thrown at channel.connect(timeOut).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I am using .53 version with Java 8 on Solarwinds free SFTP server(http://www.solarwinds.com/free-tools/free-sftp-server/). Trying to do channel connect to the box.
When I'm using channel.connect() method without timeOut value, I'm able to connect to server successfully. But when timeOut is placed as value to the channel.connect(timeOut), then I'm getting "failed to send channel request" error message. Here I used timeOut = 60000
The exception I am getting:
com.jcraft.jsch.JSchException: failed to send channel request
at com.jcraft.jsch.Request.write(Request.java:65)
at com.jcraft.jsch.RequestShell.request(RequestShell.java:49)
at com.jcraft.jsch.ChannelShell.start(ChannelShell.java:47)
at com.jcraft.jsch.Channel.connect(Channel.java:152)
Here is my code:
Exception is thrown at channel.connect(timeOut).