Package com.jcraft.jsch

Examples of com.jcraft.jsch.Session.connect()


            String username = computer.getNode().getUuid();
            LOGGER.info("Connecting via SSH '" + username + "' '" + hostName + "' '" + OpenShiftCloud.get().getPrivateKey()
                    .getAbsolutePath() + "'");
            final Session sess = jsch.getSession(username, hostName, 22);
            sess.setConfig(config);
            sess.connect();
            LOGGER.info("Connected via SSH.");

            PrintStream logger = taskListener.getLogger();
            logger.println("Attempting to connect slave...");
            logger.println("Transferring slave.jar file...");
View Full Code Here


        }

        Session session = jsch.getSession(userInfo.getName(), host, port);
        session.setUserInfo(userInfo);
        log("Connecting to " + host + ":" + port);
        session.connect();
        return session;
    }

    /**
     * Get the user information.
View Full Code Here

                if (pemFile != null) {
                    jsch.addIdentity(pemFile.getAbsolutePath(), pemPassword);
                }
                session.setUserInfo(new CfUserInfo(host, username, userPassword, pemFile,
                        pemPassword, passFile));
                session.connect();
                Message.verbose(":: SSH :: connected to " + host + "!");
                setSession(username, host, port, session);
            } catch (JSchException e) {
                if (passFile != null && passFile.exists()) {
                    passFile.delete();
View Full Code Here

                    jsch.addIdentity(pemFile.getAbsolutePath(), pemPassword);
                }
                session.setUserInfo(new CfUserInfo(host, username, userPassword, pemFile,
                        pemPassword, passFile));
                session.setDaemonThread(true);
                session.connect();
                Message.verbose(":: SSH :: connected to " + host + "!");
                setSession(username, host, port, session);
            } catch (JSchException e) {
                if (passFile != null && passFile.exists()) {
                    passFile.delete();
View Full Code Here

      config.put("StrictHostKeyChecking", "no");
      session.setConfig(config);

      ChannelSftp cSftp = null;
      try {
        session.connect(10000);

        cSftp = (ChannelSftp) session.openChannel("sftp");
        cSftp.connect();
      } catch (JSchException e) {
        LOG.error("Cannot connect to JSch session for user: " + user
View Full Code Here

    }

    LOG.info("Connecting to " + host + "...");
   
    try {
      session.connect(getSshConnectTimeout());
    } catch (JSchException e) {
      LOG.warn("Unable to connect to " + host
          + " as user " + args.user, e);
      return false;
    }
View Full Code Here

    }

    LOG.info("Connecting to " + host + "...");
   
    try {
      session.connect(getSshConnectTimeout());
    } catch (JSchException e) {
      LOG.warn("Unable to connect to " + host
          + " as user " + args.user, e);
      return false;
    }
View Full Code Here

                session.setUserInfo(ui);
            } else {
                session.setPassword(userCreds[1]);
            }

            session.connect();

            Channel channel = session.openChannel("sftp");
            channel.connect();
            ChannelSftp c = (ChannelSftp) channel;
View Full Code Here

      int retries = 0;
      while (!session.isConnected() && retries < 3) {
        try {
          retries++;
          session.connect(tms);
        } catch (JSchException e) {
          session.disconnect();
          session = null;
          // if authentication failed maybe credentials changed at the
          // remote end therefore reset credentials and retry
View Full Code Here

            }

            public void showMessage(String message) {
            }
        });
        session.connect();
        return session;
    }

    protected ClientSession createNativeSession() throws Exception {
        SshClient client = SshClient.setUpDefaultClient();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.