Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String a[]) throws JSchException, InterruptedException
- {
- java.util.Properties config = new java.util.Properties();
- JSch jsch = new JSch();
- String user = "cli";
- String host = "135.104.217.114";
- String password = "cli";
- int port = 22;
- Session session = jsch.getSession(user,host,port);
- config.put("StrictHostKeyChecking", "no");
- session.setConfig(config);
- session.setPassword(password);
- session.connect();
- while(true)
- {
- if(session.isConnected())
- {
- System.out.println("session connected");
- }
- else
- {
- System.out.println("sesion not connected--------------");
- }
- Thread.sleep(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement