Package net.schmizz.sshj

Examples of net.schmizz.sshj.SSHClient.auth()


      AgentProxy agentProxy = getAgentProxy();
      if (agentProxy == null) {
        System.err.println("No agentProxy");
        System.exit(0);
      }
      ssh.auth(System.getProperty("user.name"), getAuthMethods(agentProxy));
      final Session session = ssh.startSession();
      try {
        final Command cmd = session.exec("ping -c 1 google.com");
        System.out.println(IOUtils.readFully(cmd.getInputStream()).toString());
        cmd.join(5, TimeUnit.SECONDS);
View Full Code Here


                    throw new RuntimeIOException("Cannot read key from private key file " + privateKeyFile, e);
                }
                client.authPublickey(username, keys);
            } else if (password != null) {
                PasswordFinder passwordFinder = getPasswordFinder();
                client.auth(username, new AuthPassword(passwordFinder),
                        new AuthKeyboardInteractive(new RegularExpressionPasswordResponseProvider(passwordFinder, interactiveKeyboardAuthPromptRegex)));
            }
            sshClient = client;
            connected();
        } catch (SSHException 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.