Class SSH

java.lang.Object
javaforce.SSH

public class SSH extends Object
  • Field Details

  • Constructor Details

    • SSH

      public SSH()
  • Method Details

    • connect

      public boolean connect(String host, int port, SSH.Options options)
    • disconnect

      public void disconnect()
    • isConnected

      public boolean isConnected()
    • getOutputStream

      public OutputStream getOutputStream()
    • getInputStream

      public InputStream getInputStream()
    • getOutput

      public String getOutput()
      Get output from exec command.
    • script

      public String script(String[] cmds)
      Execute commands and return output. Commands should cause connection to terminate or function will return after timeout. Timeout = 1 min
      Parameters:
      cmds - = commands to execute
    • script

      public String script(String[] cmds, int timeout)
      Execute commands and return output. Commands should cause connection to terminate or function will return after timeout.
      Parameters:
      cmds - = commands to execute
      timeout - = timeout in ms (0 = disable)
    • usage

      public static void usage()
    • error

      public static void error(String msg)
    • main

      public static void main(String[] args)
      SSH cli client