Package com.jcraft.jsch

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


      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


            if (config.size() > 0)
            {
                session.setConfig(config);
            }

            session.connect();
        }
        catch (final Exception exc)
        {
            throw new FileSystemException("vfs.provider.sftp/connect.error", new Object[]{hostname}, exc);
        }
View Full Code Here

        }

      });
      if (!session.isConnected()) {
        try {
          session.connect();
        } catch (JSchException jse) {
          // Reset password in case the authentication failed
          if (jse.getMessage().equals("Auth fail"))
            this.password = null;
          throw jse;
View Full Code Here

          HadoopServer.this.password = pass;
        }
      });
      if (!session.isConnected()) {
        try {
          session.connect();
        } catch (JSchException jse) {
          // Reset password in case the authentication failed
          if (jse.getMessage().equals("Auth fail"))
            this.password = null;
          throw jse;
View Full Code Here

        HadoopServer.this.tunnelPassword = password;
      }
    });

    try {
      tunnel.connect();
    } catch (JSchException jse) {
      // Reset password in case the authentication failed
      if (jse.getMessage().equals("Auth fail"))
        this.tunnelPassword = null;
      throw jse;
View Full Code Here

            public void showMessage(String string)
            {
            }
        });
        session.setPassword(pass);
        session.connect();
        ChannelSftp chan = (ChannelSftp) session.openChannel("sftp");
        chan.connect();
        Vector list = chan.ls(dir);
        Iterator iterList = list.iterator();
        while (iterList.hasNext())
View Full Code Here

    protected Session createSession() throws JSchException {
        JSchLogger.init();
        JSch sch = new JSch();
        Session session = sch.getSession("sshd", "localhost", sshPort);
        session.setUserInfo(new SimpleUserInfo("sshd"));
        session.connect();
        return session;
    }

    protected void checkHtmlPage(HttpClient client, URL url) throws IOException {
        client.setHostConfiguration(new HostConfiguration());
View Full Code Here

    protected Session createSession() throws JSchException {
        JSchLogger.init();
        JSch sch = new JSch();
        Session session = sch.getSession("sshd", "localhost", sshPort);
        session.setUserInfo(new SimpleUserInfo("sshd"));
        session.connect();
        return session;
    }

    protected ClientSession createNativeSession() throws Exception {
        client = SshClient.setUpDefaultClient();
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

                @Override
                public void showMessage(String message) {
                }
            });
            // in the process of connecting, "[localhost]:<port>" is added to the knownHostsFile
            s.connect();
            s.disconnect();
        } catch (JSchException e) {
            LOG.info("Could not add [localhost] to known hosts", e);
        }
    }
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.