public final class SshByPassword extends Object
For SSH channel with authenticaton using private key.
Shell.Empty, Shell.Fake, Shell.Plain, Shell.Safe, Shell.Verbose
Constructor and Description |
---|
SshByPassword(String adr,
int prt,
String user,
String passwd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
exec(String command,
InputStream stdin,
OutputStream stdout,
OutputStream stderr)
Execute and return exit code.
|
protected com.jcraft.jsch.Session |
session()
Create and return a session, connected.
|
public SshByPassword(String adr, int prt, String user, String passwd) throws UnknownHostException
adr
- IP addressprt
- Port of serveruser
- Loginpasswd
- PasswordUnknownHostException
- If fails@RetryOnFailure(attempts=7, delay=1L, unit=MINUTES, verbose=false, randomize=true, types=java.io.IOException.class) protected com.jcraft.jsch.Session session() throws IOException
IOException
- If some IO problem insidepublic int exec(String command, InputStream stdin, OutputStream stdout, OutputStream stderr) throws IOException
Shell
exec
in interface Shell
command
- Commandstdin
- Stdin (will be closed)stdout
- Stdout (will be closed)stderr
- Stderr (will be closed)IOException
- If failsCopyright © 2012–2018 jcabi.com. All rights reserved.