Package JSSHTerminal

Class SSHSession

java.lang.Object
JSSHTerminal.SSHSession
All Implemented Interfaces:
com.jcraft.jsch.UserInfo

public final class SSHSession extends Object implements com.jcraft.jsch.UserInfo
SSH session
  • Constructor Details Link icon

    • SSHSession Link icon

      public SSHSession(MainPanel parent, int width, int height, int scrollSize)
      Parameters:
      parent - Parent terminal frame
      width - Width of the terminal. For example, 80.
      height - Height of the terminal. For example, 25.
      scrollSize - Scrollbar buffer size
  • Method Details Link icon

    • setSshPort Link icon

      public void setSshPort(int port)
      Sets the SSH port
      Parameters:
      port - Port number
    • setAnswerYes Link icon

      public void setAnswerYes(boolean enable)
      Automatically answer yes to question
      Parameters:
      enable - true to enable, false otherwise
    • setX11Forwarding Link icon

      public void setX11Forwarding(boolean enable)
      Enable X11 forwarding
      Parameters:
      enable - true to enable, false otherwise
    • execCommand Link icon

      public void execCommand(String cmd) throws IOException
      Execute the given command
      Parameters:
      cmd - Command to be executed (Do not add \n at the end)
      Throws:
      IOException
    • connect Link icon

      public void connect(String host, String user, String password) throws IOException
      Connect to a host using name and password.
      Parameters:
      host - Host to connect
      user - username
      password - password (if null, password will be prompted)
      Throws:
      IOException
    • isConnected Link icon

      public boolean isConnected()
    • close Link icon

      public void close()
    • write Link icon

      public void write(String k)
    • getTerminal Link icon

      public TerminalEmulator getTerminal()
    • getPassphrase Link icon

      public String getPassphrase()
      Specified by:
      getPassphrase in interface com.jcraft.jsch.UserInfo
    • getPassword Link icon

      public String getPassword()
      Specified by:
      getPassword in interface com.jcraft.jsch.UserInfo
    • promptPassword Link icon

      public boolean promptPassword(String message)
      Specified by:
      promptPassword in interface com.jcraft.jsch.UserInfo
    • promptPassphrase Link icon

      public boolean promptPassphrase(String s)
      Specified by:
      promptPassphrase in interface com.jcraft.jsch.UserInfo
    • promptYesNo Link icon

      public boolean promptYesNo(String str)
      Specified by:
      promptYesNo in interface com.jcraft.jsch.UserInfo
    • showMessage Link icon

      public void showMessage(String s)
      Specified by:
      showMessage in interface com.jcraft.jsch.UserInfo