|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.ssh2.SSH2SimpleClient
public class SSH2SimpleClient
This class implements the most basic variant of a ssh2 client. It
creates the userauth, and connection layers (i.e. instances of
SSH2UserAuth
, and SSH2Connection
). The
only thing which needs to be provided is an initialized
SSH2Transport
instance, user authentication data. The
constructor is active in that it does all the required work to set
up the complete protocol stack, hence it can throw exceptions which
can occur.
This simple client can easily be used as the basis for example to build
tunneling capabilities into any java app. requiring secure connections. For
doing remote command execution and/or controlling input/output of a command
or shell the class SSH2ConsoleRemote
can be used to have easy
access to command execution and/or input/output as
java.io.InputStream
and java.io.OutpuStream
SSH2Transport
,
SSH2Connection
,
SSH2ConsoleRemote
,
SSH2Preferences
,
RunRemoteCommand
,
RemoteShellScript
Field Summary | |
---|---|
protected SSH2Connection |
connection
|
protected SSH2Transport |
transport
|
protected SSH2UserAuth |
userAuth
|
Constructor Summary | |
---|---|
SSH2SimpleClient(SSH2Transport transport,
boolean hostbased,
java.lang.String username,
java.lang.String keyFile,
java.lang.String keyPassword)
Simple constructor to use for publickey / hostbased authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
boolean hostbased,
java.lang.String username,
java.lang.String keyFile,
java.lang.String keyPassword,
long timeout)
Simple constructor to use for publickey / hostbased authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
SSH2Authenticator authenticator)
Constructor to use when more than one authentication method need to be used and/or other methods than the ones supported above. |
|
SSH2SimpleClient(SSH2Transport transport,
SSH2Authenticator authenticator,
long timeout)
Constructor to use when more than one authentication method need to be used and/or other methods than the ones supported above. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
long timeout)
Constructor to use for GSSAPI authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
SSH2Interactor interactor)
Constructor to use for keyboard interactive authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
SSH2Interactor interactor,
long timeout)
Constructor to use for keyboard interactive authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
java.lang.String password)
Simple constructor to use for password authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
java.lang.String password,
long timeout)
Simple constructor to use for password authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
java.lang.String keyFile,
java.lang.String keyPassword)
Simple constructor to use for publickey authentication. |
|
SSH2SimpleClient(SSH2Transport transport,
java.lang.String username,
java.lang.String keyFile,
java.lang.String keyPassword,
long timeout)
Simple constructor to use for publickey authentication. |
Method Summary | |
---|---|
SSH2Connection |
getConnection()
|
SSH2Transport |
getTransport()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SSH2Transport transport
protected SSH2Connection connection
protected SSH2UserAuth userAuth
Constructor Detail |
---|
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, java.lang.String password, long timeout) throws SSH2Exception
transport
- connected transport layerusername
- name of userpassword
- password of usertimeout
- timeout in milliseconds for authentication
phase (0 means no timeout)
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, java.lang.String password) throws SSH2Exception
transport
- connected transport layerusername
- name of userpassword
- password of user
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, java.lang.String keyFile, java.lang.String keyPassword) throws SSH2Exception, java.io.IOException
transport
- connected transport layerusername
- name of userkeyFile
- name of private key file to use for authenticationkeyPassword
- password protecting private key file (null if none)
SSH2Exception
java.io.IOException
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, java.lang.String keyFile, java.lang.String keyPassword, long timeout) throws SSH2Exception, java.io.IOException
transport
- connected transport layerusername
- name of userkeyFile
- name of private key file to use for authenticationkeyPassword
- password protecting private key file (null if none)timeout
- timeout in milliseconds for authentication phase (0 means no timeout)
SSH2Exception
java.io.IOException
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, boolean hostbased, java.lang.String username, java.lang.String keyFile, java.lang.String keyPassword) throws SSH2Exception, java.io.IOException
transport
- connected transport layerhostbased
- whether hostbased or publickey auth. should be used,
set to true to use hostbased, and false to use publickeyusername
- name of userkeyFile
- name of private key file to use for authenticationkeyPassword
- password protecting private key file (null if none)
SSH2Exception
java.io.IOException
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, boolean hostbased, java.lang.String username, java.lang.String keyFile, java.lang.String keyPassword, long timeout) throws SSH2Exception, java.io.IOException
transport
- connected transport layerhostbased
- whether hostbased or publickey auth. should be used,
set to true to use hostbased, and false to use publickeyusername
- name of userkeyFile
- name of private key file to use for authenticationkeyPassword
- password protecting private key file (null if none)timeout
- timeout in milliseconds for authentication phase (0 means no timeout)
SSH2Exception
java.io.IOException
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, SSH2Interactor interactor, long timeout) throws SSH2Exception
transport
- connected transport layerusername
- name of userinteractor
- interactor instance to handle user
interaction in authenticationtimeout
- timeout in milliseconds for authentication phase (0 means no timeout)
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, SSH2Interactor interactor) throws SSH2Exception
transport
- connected transport layerusername
- name of userinteractor
- interactor instance to handle user
interaction in authentication
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, java.lang.String username, long timeout) throws SSH2Exception
transport
- connected transport layerusername
- name of usertimeout
- timeout in milliseconds for authentication phase (0 means no timeout)
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, SSH2Authenticator authenticator) throws SSH2Exception
transport
- connected transport layerauthenticator
- authenticator instance prepared with needed methods
SSH2Exception
SSH2Transport
public SSH2SimpleClient(SSH2Transport transport, SSH2Authenticator authenticator, long timeout) throws SSH2Exception
transport
- connected transport layerauthenticator
- authenticator instance prepared with needed methodstimeout
- timeout in milliseconds for authentication phase (0 means no timeout)
SSH2Exception
SSH2Transport
Method Detail |
---|
public SSH2Transport getTransport()
public SSH2Connection getConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |