类 SshjClient

    • 方法详细资料

      • newInstance

        public static SshjClient newInstance​(String sshServerHost,
                                             int sshServerPort,
                                             String userName,
                                             Path privateKeyPath)
      • connect

        public boolean connect()
        从接口复制的说明: ConnectSSH
        Connect with SSH Server
        指定者:
        connect 在接口中 ConnectSSH
        返回:
      • disconnect

        public void disconnect()
        从接口复制的说明: ConnectSSH
        Disconnect with SSH Server
        指定者:
        disconnect 在接口中 ConnectSSH
      • setLocalPortForwarding

        public void setLocalPortForwarding​(int localPort,
                                           String remoteHost,
                                           int remotePort)
        从接口复制的说明: HasSshTunnel
        Setup SSH tunnel(Local Port Forwarding) (localhost:port to remoteHost:remotePort)
        指定者:
        setLocalPortForwarding 在接口中 HasSshTunnel
      • unsetLocalPortForwarding

        public void unsetLocalPortForwarding​(int localPort)
        从接口复制的说明: HasSshTunnel
        Remove SSH tunnel(Local Port Forwarding) from the specific local port
        指定者:
        unsetLocalPortForwarding 在接口中 HasSshTunnel
      • executeCommand

        public String executeCommand​(String command)
        从接口复制的说明: HasSshExec
        Remote execute command or commands
        Single command like: pwd
        Multiple commands like: cd..; pwd; ls -al;
        Open a new channel for each invoke
        指定者:
        executeCommand 在接口中 HasSshExec
        返回: