Module bus.extra

Class SshjKit

java.lang.Object
org.miaixz.bus.extra.ssh.SshjKit

public class SshjKit extends Object
Utility class for SSHJ, a Java library for SSH. This class provides a simplified way to create and configure an SSHClient. Project homepage: https://github.com/hierynomus/sshj
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • SshjKit

      public SshjKit()
  • Method Details

    • openClient

      public static net.schmizz.sshj.SSHClient openClient(Connector connector)
      Opens and authenticates an SSH client connection using the provided connection details. This method configures the client with a promiscuous host key verifier, sets timeouts, connects to the server, and authenticates using a password.
      Parameters:
      connector - The Connector object containing connection information (host, port, user, password, timeout).
      Returns:
      An initialized and authenticated SSHClient instance.
      Throws:
      org.miaixz.bus.core.lang.exception.InternalException - if an IOException occurs during connection or authentication.