Package com.jcabi.ssh

Class SshByPassword

    • Method Detail

      • session

        @RetryOnFailure(attempts=7,
                        delay=1L,
                        unit=MINUTES,
                        verbose=false,
                        types=java.io.IOException.class)
        protected com.jcraft.jsch.Session session()
                                           throws IOException
        Create and return a session, connected.
        Returns:
        JSch session
        Throws:
        IOException - If some IO problem inside
      • exec

        public int exec​(String command,
                        InputStream stdin,
                        OutputStream stdout,
                        OutputStream stderr)
                 throws IOException
        Description copied from interface: Shell
        Execute and return exit code.
        Specified by:
        exec in interface Shell
        Parameters:
        command - Command
        stdin - Stdin (will be closed)
        stdout - Stdout (will be closed)
        stderr - Stderr (will be closed)
        Returns:
        Exit code
        Throws:
        IOException - If fails