You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I have been trying to get this code working for the past 5-6 hrs but I have had no success so far. Kindly help me resolve this issue. I am working on eclipse and I want to ssh into my raspberry pi using SSHByPassword. I downloaded the jcabi-ssh-1.5-jar-with-depencies.jar. Running my code with this gives me the error :
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.io.IOException: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
at com.jcabi.ssh.SSHByPassword.session(SSHByPassword.java:147)
at com.jcabi.ssh.SSHByPassword.exec(SSHByPassword.java:108)
at com.jcabi.ssh.Shell$Plain.exec(Shell.java:172)
at Hope.main(Hope.java:10)
Caused by: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
at com.jcraft.jsch.Session.connect(Session.java:558)
at com.jcraft.jsch.Session.connect(Session.java:183)
at com.jcabi.ssh.SSHByPassword.session(SSHByPassword.java:144)
... 3 more
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> Next I added slf4j-nop-1.7.13.jar to my project reference library. I get the following error now:
Exception in thread "main" java.io.IOException: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
at com.jcabi.ssh.SSHByPassword.session(SSHByPassword.java:147)
at com.jcabi.ssh.SSHByPassword.exec(SSHByPassword.java:108)
at com.jcabi.ssh.Shell$Plain.exec(Shell.java:172)
at Hope.main(Hope.java:10)
Caused by: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
at com.jcraft.jsch.Session.connect(Session.java:558)
at com.jcraft.jsch.Session.connect(Session.java:183)
at com.jcabi.ssh.SSHByPassword.session(SSHByPassword.java:144)
... 3 more
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
My code is as follows:
import com.jcabi.ssh.Shell;
import java.io.IOException;
import java.net.UnknownHostException;
import com.jcabi.ssh.SSHByPassword;
import com.jcabi.log.*;
public class Try {
public static void main(String[] args) throws IOException{
Shell shell = new SSHByPassword("192.168.1.2", 22, "pi", "abc");
String stdout = new Shell.Plain(shell).exec("echo 'Hello, world!'");
}
}
The text was updated successfully, but these errors were encountered:
Hi
I have been trying to get this code working for the past 5-6 hrs but I have had no success so far. Kindly help me resolve this issue. I am working on eclipse and I want to ssh into my raspberry pi using SSHByPassword. I downloaded the jcabi-ssh-1.5-jar-with-depencies.jar. Running my code with this gives me the error :
My code is as follows:
The text was updated successfully, but these errors were encountered: