Package org.jline.builtins.ssh
Class Ssh
java.lang.Object
org.jline.builtins.ssh.Ssh
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSsh(Consumer<Ssh.ShellParams> shell, Consumer<Ssh.ExecuteParams> execute, Supplier<org.apache.sshd.server.SshServer> serverBuilder, Supplier<org.apache.sshd.client.SshClient> clientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoidssh(Terminal terminal, LineReader reader, String user, InputStream stdin, PrintStream stdout, PrintStream stderr, String[] argv) Connects to an SSH server and either executes a remote command or opens an interactive shell.voidsshd(PrintStream stdout, PrintStream stderr, String[] argv)
-
Field Details
-
functions
-
-
Constructor Details
-
Ssh
public Ssh(Consumer<Ssh.ShellParams> shell, Consumer<Ssh.ExecuteParams> execute, Supplier<org.apache.sshd.server.SshServer> serverBuilder, Supplier<org.apache.sshd.client.SshClient> clientBuilder)
-
-
Method Details
-
ssh
public void ssh(Terminal terminal, LineReader reader, String user, InputStream stdin, PrintStream stdout, PrintStream stderr, String[] argv) throws Exception Connects to an SSH server and either executes a remote command or opens an interactive shell. Parses connection target from argv (optionally containing user and port), establishes an SSH client session, and forwards local stdin/stdout/stderr to the remote side. In interactive mode configures a PTY from the provided Terminal, installs signal handlers for window changes and job-control signals, and restores terminal state on exit.- Parameters:
terminal- the Terminal used for raw-mode control, PTY geometry, and signal handlingreader- a LineReader used for user interaction (passwords/prompts)user- the default username to use if not specified in argvstdin- input stream to forward to the remote sessionstdout- output stream to receive remote standard outputstderr- output stream to receive remote standard error and interaction errorsargv- command-line arguments; first positional is target ([user@]host[:port]) and remaining tokens form an optional remote command; supports --help- Throws:
Exception- for SSH, authentication, or I/O errors that occur while connecting or during remote command/shell execution
-
sshd
- Throws:
Exception
-