|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maverick.nio.ProtocolContext
com.maverick.sshd.SshContext
public class SshContext
This class defines an SSH context for listening interfaces on the
Daemon.
| Field Summary | |
|---|---|
static int |
ANY
|
static String |
CIPHER_AES128_CBC
The AES 128 bit cipher |
static String |
CIPHER_AES192_CBC
The AES 192 bit cipher |
static String |
CIPHER_AES256_CBC
The AES 128 bit cipher |
static String |
CIPHER_BLOWFISH_CBC
The Blowfish CBC cipher |
static String |
CIPHER_TRIPLEDES_CBC
The 3DES CBC cipher |
static String |
COMPRESSION_NONE
Compression off |
static String |
COMPRESSION_ZLIB
ZLIB compression |
static String |
HMAC_MD5
MD5 message authentication |
static String |
HMAC_SHA1
SHA1 message authentication |
static String |
KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
Constant for the algorithm name "diffie-hellman-group-exchange-sha1". |
static String |
KEX_DIFFIE_HELLMAN_GROUP1_SHA1
Constant for the algorithm name "diffie-hellman-group1-sha1". |
static String |
KEX_DIFFIE_HELLMAN_GROUP14_SHA1
Constant for the algorithm name "diffie-hellman-group14-sha1". |
static int |
KEYBOARD_INTERACTIVE
|
static String |
KEYBOARD_INTERACTIVE_AUTHENTICATION
|
static int |
PASSWORD
|
static String |
PASSWORD_AUTHENTICATION
Identifier for password authentication |
static int |
PUBLIC_KEY
|
static String |
PUBLIC_KEY_SSHDSS
SSH2 DSA Public Key |
static String |
PUBLIC_KEY_SSHRSA
SSH2 RSA Public Key |
static int |
PUBLIC_KEYandPASSWORD
|
static String |
PUBLICKEY_AUTHENTICATION
Identifier for public key authentication |
| Fields inherited from class com.maverick.nio.ProtocolContext |
|---|
keepAlive, receiveBufferSize, reuseAddress, sendBufferSize, tcpNoDelay |
| Constructor Summary | |
|---|---|
SshContext()
Constructs a default context but does not set the daemon |
|
SshContext(Daemon daemon)
Constructs a default context |
|
| Method Summary | |
|---|---|
void |
addGlobalRequestHandler(GlobalRequestHandler handler)
|
void |
addHostKey(com.maverick.ssh.components.SshKeyPair keyPair)
Add a host key to the configuration. |
void |
addRequiredAuthentication(String method)
Set an authentication method as required. |
Object |
clone()
|
ProtocolEngine |
createEngine()
|
static com.maverick.ssh.components.SshKeyPair |
GenerateKeyFiles(File keyFilename,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat)
Generate a public and private key pair, save them to keyFilename and keyFilename.pub, return the key pair |
AccessManager |
getAccessManager()
Get the current AccessManager for this configuration. |
boolean |
getAllowDeniedKEX()
|
AuthenticationProvider |
getAuthenticationProvider()
Get the AuthenticationProvider for
this SSHD instance. |
String |
getBannerMessage()
Get the authentication banner to display to connecting clients. |
int |
getChannelLimit()
Get the maximum number of open channels allowed by each client. |
String |
getCiphersCS()
|
String |
getCiphersSC()
Get the ciphers for the Server->Client stream. |
int |
getCompressionLevel()
Get the current compression level |
String |
getDefaultTerminal()
Get the default terminal to execute when the user requests to start a shell. |
FileSystemFactory |
getFileSystemProvider()
Get the FileSystem for this SSHD
instance. |
ForwardingCallback |
getForwardingCallback()
Get the forwarding callback implementation for this server context. |
GlobalRequestHandler |
getGlobalRequestHandler(String requestname)
|
com.maverick.ssh.components.SshKeyPair |
getHostKey(String algorithm)
Get the SSHD host key for a given algorithm. |
com.maverick.ssh.components.SshKeyPair[] |
getHostKeys()
Get all the hosts keys. |
int |
getIdleConnectionTimeoutSeconds()
The number of seconds before an idle connection is dropped. |
int |
getKeepAliveDataMaxLength()
Get the maximum data length for the keep-alive packet. |
int |
getKeepAliveInterval()
Get the current keep-alive interval (in seconds). |
Configuration |
getKerberosConfiguration()
Get the custom Kerberos configuration. |
String |
getKerberosDC()
Get the Kerberos domain controller address . |
String |
getKerberosRealm()
Get the realm name to use for GSSAPI Kerberos authentication. |
char[] |
getKerberosServicePassword()
Get the Kerberos service account password. |
String |
getKerberosServicePrincipal()
Get the Kerberos service account password. |
KeyboardInteractiveProviderFactory |
getKeyboardInteractiveProviderFactory()
Get the current provider for keyboard-interactive authentication |
int |
getKeyExchangePacketLimit()
Get the number of packets to send before a key exchange is forced |
String |
getKeyExchanges()
Get the ciphers for the Server->Client stream. |
int |
getKeyExchangeTransferLimit()
Get the number of bytes to transfer before a key exchange is forced. |
String |
getMacsCS()
Get the ciphers for the Client->Server stream. |
String |
getMacsSC()
Get the ciphers for the Server->Client stream. |
int |
getMaxAuthentications()
Get the maximum number of failed authentications allowed for each connection. |
int |
getMaximumConnections()
Get the maximum number of connections allowed at any one time. |
int |
getMaximumPacketLength()
Get the maximum supported length of an SSH packet. |
int |
getMaximumPublicKeyVerificationAttempts()
Get the number of public keys that each user can attempt to verify for public key authentication. |
int |
getMaximumSocketsBacklogPerRemotelyForwardedConnection()
|
String |
getPreferredCipherCS()
Get the currently preferred cipher for the Client->Server stream. |
String |
getPreferredCipherSC()
Get the currently preferred cipher for the Server->Client stream. |
String |
getPreferredCompressionCS()
Get the currently preferred compression for the Client->Server stream. |
String |
getPreferredCompressionSC()
Get the currently preferred compression for the Server->Client stream. |
String |
getPreferredKeyExchange()
Get the currently preferred key exchange method. |
String |
getPreferredMacCS()
Get the currently preferred mac for the Client->Server stream. |
String |
getPreferredMacSC()
Get the currently supported mac for the Server-Client stream. |
String |
getPreferredPublicKey()
Get the currently preferred public key algorithm. |
String |
getPublicKeys()
Get the ciphers for the Server->Client stream. |
PublicKeyStore |
getPublicKeyStore()
Get the currently configured public key store for authorizing public keys |
boolean |
getRemoteForwardingCancelKillsTunnels()
Determines whether the cancellation of a remote forwarding drops currently active tunnels |
Class |
getRemoteForwardingFactoryImpl()
|
Class |
getRemoteForwardingManagerImpl()
|
String[] |
getRequiredAuthentications()
Lists the required authentication methods. |
Daemon |
getServer()
Get the instance of the SSHD for this context. |
int |
getSessionTimeout()
Returns the session timeout in seconds |
String |
getSFTPCharsetEncoding()
Get the current encoding value for filenames in SFTP sessions. |
String |
getSoftwareVersionComments()
Get the software/version/comments field that is to be used in the SSH protocols negotiation procedure. |
String |
getSupportedPublicKeys()
Returns a comma delimited string containing installed public key types. |
String |
getTooManyConnectionsText()
|
boolean |
hasPublicKey(String algorithm)
Determine if the server has a host key configured. |
void |
init(Daemon daemon)
Initialise the SshContext by setting the daemon |
boolean |
isFileSystemAsynchronous()
Get the file system operation mode; asynchronous (spawn a thread for each SFTP session so that file operations are not performed on the selector thread) or synchronous (use the selector thread - may affect performance on slow file systems (e.g. |
com.maverick.ssh.components.SshKeyPair |
loadKey(File key,
String passPhrase)
|
void |
loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase)
Load a keystore for use as an SSH host key. |
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength)
Load a host key from file, if the file does not exist then generate the key. |
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat,
String passPhrase)
Load a host key from file, if the file does not exist then generate the key. |
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength,
String passPhrase)
|
void |
setAccessManager(AccessManager accessManager)
If you want to control access to individual SSH features then add an instance of the AccessManager here. |
void |
setAllowDeniedKEX(boolean allowKeyExchangeForDeniedConnection)
|
void |
setAsynchronousFileOperations(boolean asynchronousFileOperations)
Tell the server which file system operation mode to use; asynchronous (spawn a thread for each SFTP session so that file operations are not performed on the selector thread) or synchronous (use the selector thread - may affect performance on slow file systems (e.g networked)) |
void |
setAuthenticationProvider(AuthenticationProvider authenticationProvider)
Set the AuthenticationProvider for
this SSHD instance. |
void |
setBannerMessage(String authenticationBanner)
Set the banner message that is displayed to all connecing clients prior to authentication. |
void |
setChannelLimit(int maxChannels)
Set the maximum number of open channels allowed by each client (defaults to 100). |
void |
setCipherPreferredPositionCS(String name,
int position)
|
void |
setCipherPreferredPositionSC(String name,
int position)
|
void |
setCompressionLevel(int compressionLevel)
Set the compression level to use if compression is enabled |
void |
setDefaultTerminal(String defaultTerminal)
Set the default terminal to execute when the user requests to start a shell. |
void |
setFileSystemFactory(FileSystemFactory filesystemFactory)
Set the FileSystem for this SSHD
instance. |
void |
setForwardingCallback(ForwardingCallback forwardingCallback)
Set the forwarding callback implementation for this server context. |
void |
setIdleConnectionTimeoutSeconds(int idleConnectionTimeout)
Set the number of seconds before an idle connection is dropped. |
void |
setKeepAliveDataMaxLength(int keepAliveDataMaxLength)
Set the maximum data length for the keep-alive packet. |
void |
setKeepAliveInterval(int keepAliveInterval)
Set the keep-alive interval (in seconds). |
void |
setKerberosConfiguration(Configuration kerberosConfiguration)
Set the custom Kerberos configuration. |
void |
setKerberosDC(String kerberosDC)
Set the Kerberos domain controller address . |
void |
setKerberosRealm(String kerberosRealm)
Set the realm name to use for GSSAPI Kerberos authentication. |
void |
setKerberosServicePassword(char[] kerberosServicePassword)
Set the Kerberos service account password. |
void |
setKerberosServicePrincipal(String kerberosServicePrincipal)
Set the Kerberos service account princial. |
void |
setKeyboardInteractiveProvider(KeyboardInteractiveProviderFactory kbiFactory)
Set the provider for keyboard-interactive authentication. |
void |
setKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY)
This tells the server how many packets to use before a key exchange. |
void |
setKeyExchangePreferredPosition(String name,
int position)
|
void |
setKeyExchangeTransferLimit(int MAX_NUM_BYTES_BEFORE_REKEY)
This limit tells the server when to force a key exchange. |
void |
setMacPreferredPositionCS(String name,
int position)
|
void |
setMacPreferredPositionSC(String name,
int position)
|
void |
setMaxAuthentications(int maxAuthentications)
Set the maximum number of failed authentications allowed for each connection. |
void |
setMaximumConnections(int maximumConnections)
Set the maximum number of connections allowed at any one time. |
void |
setMaximumPacketLength(int maximumPacketLength)
Set the maximum supported length of an SSH packet. |
void |
setMaximumPublicKeyVerificationAttempts(int maximumPublicKeyVerificationAttempts)
Set the number of public keys that a user can verify for public key authentication. |
void |
setMaximumSocketsBacklogPerRemotelyForwardedConnection(int maximumSocketsBacklogPerRemotelyForwardedConnection)
|
void |
setPreferredCipherCS(int[] order)
Set the preferred SC cipher order |
void |
setPreferredCipherCS(String name)
Set the preferred cipher for the Client->Server stream. |
void |
setPreferredCipherSC(int[] order)
Set the preferred SC cipher order |
void |
setPreferredCipherSC(String name)
Set the preferred cipher for the Server->Client stream. |
void |
setPreferredCompressionCS(String name)
Set the preferred compression for the Client->Server stream. |
void |
setPreferredCompressionSC(String name)
Set the preferred compression for the Server->Client stream. |
void |
setPreferredKeyExchange(String name)
Set the preferred key exchange method. |
void |
setPreferredMacCS(int[] order)
Set the preferred CS Mac order |
void |
setPreferredMacCS(String name)
Set the preferred MAC for the Client->Server stream. |
void |
setPreferredMacSC(int[] order)
Set the preferred SC Mac order |
void |
setPreferredMacSC(String name)
Set the preferred mac for the Server->Client stream. |
void |
setPreferredPublicKey(String name)
Set the preferred public key algorithm. |
void |
setPublicKeyPreferredPosition(String name,
int position)
|
void |
setPublicKeyStore(PublicKeyStore publicKeyStore)
For publickey authentication you can optionally provide an alternative key store implementation. |
void |
setRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel)
When the user cancels a remote forwarding should active tunnels be dropped? |
void |
setRemoteForwardingFactoryImpl(Class remoteForwardingChannelFactory)
|
void |
setRemoteForwardingManagerImpl(Class remoteForwardingManagerImpl)
|
void |
setRequiredAuthenticationMethods(int authmethods)
|
void |
setSessionTimeout(int sessionTimeoutSeconds)
Sets the session timeout in seconds |
void |
setSFTPCharsetEncoding(String sftpCharsetEncoding)
Set the default encoding for filenames in SFTP sessions. |
void |
setSoftwareVersionComments(String softwareVersionComments)
Set the current implementations software/version/comments field that is used during the SSH protocols negotiation procedure. |
void |
setTooManyConnectionsText(String tooManyConnectionsText)
|
com.maverick.ssh.components.ComponentFactory |
supportedAuthenticationMechanisms()
Get the supported authentication mechanisms. |
com.maverick.ssh.components.ComponentFactory |
supportedChannels()
Get the supported Channel's for this SSHD
instance. |
com.maverick.ssh.components.ComponentFactory |
supportedCiphersCS()
Returns a factory implementation that enables configuration of the available ciphers. |
com.maverick.ssh.components.ComponentFactory |
supportedCiphersSC()
|
com.maverick.ssh.components.ComponentFactory |
supportedCommands()
Get the supported ExecutableCommand's
for this context. |
com.maverick.ssh.components.ComponentFactory |
supportedCompressionsCS()
Get the supported compression algorithms. |
com.maverick.ssh.components.ComponentFactory |
supportedCompressionsSC()
|
com.maverick.ssh.components.ComponentFactory |
supportedKeyExchanges()
Get the supported key exchange methods. |
com.maverick.ssh.components.ComponentFactory |
supportedMacsCS()
Get the supported message authentication algorithms. |
com.maverick.ssh.components.ComponentFactory |
supportedMacsSC()
|
com.maverick.ssh.components.ComponentFactory |
supportedPublicKeys()
|
com.maverick.ssh.components.ComponentFactory |
supportedSubsystems()
Get the supported Subsystem's for this SSHD
instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CIPHER_TRIPLEDES_CBC
public static final String CIPHER_BLOWFISH_CBC
public static final String CIPHER_AES128_CBC
public static final String CIPHER_AES192_CBC
public static final String CIPHER_AES256_CBC
public static final String HMAC_SHA1
public static final String HMAC_MD5
public static final String COMPRESSION_NONE
public static final String COMPRESSION_ZLIB
public static final String KEX_DIFFIE_HELLMAN_GROUP1_SHA1
public static final String KEX_DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
public static final String KEX_DIFFIE_HELLMAN_GROUP14_SHA1
public static final String PUBLIC_KEY_SSHDSS
public static final String PUBLIC_KEY_SSHRSA
public static final String PASSWORD_AUTHENTICATION
public static final String PUBLICKEY_AUTHENTICATION
public static final String KEYBOARD_INTERACTIVE_AUTHENTICATION
public static final int ANY
public static final int PUBLIC_KEY
public static final int PASSWORD
public static final int PUBLIC_KEYandPASSWORD
public static final int KEYBOARD_INTERACTIVE
| Constructor Detail |
|---|
public SshContext()
throws IOException
IOException
public SshContext(Daemon daemon)
throws IOException
IOException| Method Detail |
|---|
public String getKerberosRealm()
Configuration has been set using
setKerberosConfiguration(Configuration).
public void setKerberosRealm(String kerberosRealm)
kerberosRealm - kerberos realmpublic String getKerberosDC()
public void setKerberosDC(String kerberosDC)
kerberosDC - kerberos domain controllerpublic char[] getKerberosServicePassword()
public void setKerberosServicePassword(char[] kerberosServicePassword)
kerberosServicePassword - param kerberos service account passwordpublic String getKerberosServicePrincipal()
Configuration has been set using
setKerberosConfiguration(Configuration).
public void setKerberosServicePrincipal(String kerberosServicePrincipal)
Configuration has been set using
setKerberosConfiguration(Configuration).
kerberosServicePrincipal - kerberos service account principalpublic Configuration getKerberosConfiguration()
null.
public void setKerberosConfiguration(Configuration kerberosConfiguration)
null.
kerberosConfiguration - kerberos configurationpublic void init(Daemon daemon)
public ProtocolEngine createEngine()
throws IOException
createEngine in class ProtocolContextIOException
public void loadOrGenerateHostKey(File key,
String type,
int bitlength)
throws IOException,
com.sshtools.publickey.InvalidPassphraseException,
com.maverick.ssh.SshException
key - the key filetype - the type of key; acceptable values are
SshKeyPairGenerator.SSH2_RSA or SshKeyPairGenerator.SSH2_DSAbitlength - the bit length of the key
IOException
com.maverick.ssh.SshException
com.sshtools.publickey.InvalidPassphraseException
public void loadOrGenerateHostKey(File key,
String type,
int bitlength,
String passPhrase)
throws IOException,
com.sshtools.publickey.InvalidPassphraseException,
com.maverick.ssh.SshException
IOException
com.sshtools.publickey.InvalidPassphraseException
com.maverick.ssh.SshException
public void loadOrGenerateHostKey(File key,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat,
String passPhrase)
throws IOException,
com.sshtools.publickey.InvalidPassphraseException,
com.maverick.ssh.SshException
key - the key filetype - the type of key; acceptable values are
SshKeyPairGenerator.SSH2_RSA or SshKeyPairGenerator.SSH2_DSAbitlength - the bit length of the keyprivateKeyFormat - the format of the private key, SshPrivateKeyFileFactorypublicKeyFormat - the format of the public key, {see
com.sshtools.publickey.SshPublicKeyFileFactory}passPhrase - the passPhrase of an existing host key
IOException
com.maverick.ssh.SshException
com.sshtools.publickey.InvalidPassphraseException
public com.maverick.ssh.components.SshKeyPair loadKey(File key,
String passPhrase)
throws IOException,
com.sshtools.publickey.InvalidPassphraseException
IOException
com.sshtools.publickey.InvalidPassphraseException
public static com.maverick.ssh.components.SshKeyPair GenerateKeyFiles(File keyFilename,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat)
throws IOException,
com.maverick.ssh.SshException
keyFilename - type - bitlength - privateKeyFormat - publicKeyFormat -
IOException
com.maverick.ssh.SshException
public void loadKeystore(File keystoreFile,
String alias,
String storePassphrase,
String keyPassphrase)
throws IOException
keystoreFile - path to the keystore filealias - the alias of the key in the keystorestorePassphrase - the passphrase of the keystorekeyPassphrase - the passphrase of the key
IOExceptionpublic void addGlobalRequestHandler(GlobalRequestHandler handler)
public GlobalRequestHandler getGlobalRequestHandler(String requestname)
public Class getRemoteForwardingFactoryImpl()
public Class getRemoteForwardingManagerImpl()
public void setRemoteForwardingFactoryImpl(Class remoteForwardingChannelFactory)
throws IOException
IOException
public void setRemoteForwardingManagerImpl(Class remoteForwardingManagerImpl)
throws IOException
IOExceptionpublic void setPublicKeyStore(PublicKeyStore publicKeyStore)
publicKeyStore - PublicKeyStorepublic PublicKeyStore getPublicKeyStore()
public String[] getRequiredAuthentications()
public void addRequiredAuthentication(String method)
Set an authentication method as required. You can have multiple required
authentications but by default none are required, although at least one
authentication MUST be performed. For example to require both password
and publickey authentication use the following statements in the
SshDaemon#configure(ConfigurationContext) method.
context.addRequiredAuthentication(ConfigurationContext.PUBLICKEY_AUTHENTICATION); context.addRequiredAuthentication(ConfigurationContext.PASSWORD_AUTHENTICATION);
method - Stringpublic String getBannerMessage()
public Daemon getServer()
public String getSFTPCharsetEncoding()
public void setSFTPCharsetEncoding(String sftpCharsetEncoding)
sftpCharsetEncoding - Stringpublic int getSessionTimeout()
public void setSessionTimeout(int sessionTimeoutSeconds)
sessionTimeoutSeconds - intpublic void setChannelLimit(int maxChannels)
maxChannels - public int getChannelLimit()
public int getMaxAuthentications()
public void setMaxAuthentications(int maxAuthentications)
maxAuthentications - public void setMaximumConnections(int maximumConnections)
maximumConnections - intpublic int getMaximumConnections()
public com.maverick.ssh.components.ComponentFactory supportedCiphersCS()
Returns a factory implementation that enables configuration of the available ciphers.
The standard default ciphers installed are 3DES and Blowfish, however the
J2SSH Maverick API on which this server is based also supports a number
of optional ciphers AES, CAST and Twofish. These can be installed by
adding the sshtools-cipher.jar to your class path and using the
following code within your SSHD
SshDaemon#configure(ConfigurationContext) method.
// import the cipher package import com.sshtools.cipher.*; // Add AES context.supportedCiphers().add(AES128Cbc.AES128_CBC, AES128Cbc.class); context.supportedCiphers().add(AES192Cbc.AES192_CBC, AES192Cbc.class); context.supportedCiphers().add(AES256Cbc.AES256_CBC, AES256Cbc.class); // Add Twofish - note the 256 bit cipher has two different entries to maintain backwards compatibility context.supportedCiphers().add(Twofish128Cbc.TWOFISH128_CBC, Twofish128Cbc.class); context.supportedCiphers().add(Twofish192Cbc.TWOFISH192_CBC, Twofish192Cbc.class); context.supportedCiphers().add(Twofish256Cbc.TWOFISH256_CBC, Twofish256Cbc.class); context.supportedCiphers().add(Twofish256Cbc.TWOFISH_CBC, Twofish256Cbc.class); // Add CAST context.supportedCiphers().add(CAST128Cbc.CAST128_CBC, CAST128Cbc.class);
public com.maverick.ssh.components.ComponentFactory supportedCiphersSC()
public void setAsynchronousFileOperations(boolean asynchronousFileOperations)
asynchronousFileOperations - public boolean isFileSystemAsynchronous()
public String getPreferredCipherCS()
public void setPreferredCipherCS(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred cipher for the Client->Server stream.
Use the static fields available within this class (or the com.sshtools.cipher classes) to identify the correct cipher.
context.setPreferredCipherCS(ConfigurationContext.CIPHER_BLOWFISH_CBC);
name -
IOException - if the cipher is not supported
com.maverick.ssh.SshExceptionpublic void setAccessManager(AccessManager accessManager)
AccessManager here. The AccessManager is
consulted before a user is allowed to connect, start a shell, execute a
command or start a port forwarding connection.
accessManager - public AccessManager getAccessManager()
AccessManager for this configuration.
public void setBannerMessage(String authenticationBanner)
authenticationBanner - public String getPreferredCipherSC()
public String getSoftwareVersionComments()
public void setSoftwareVersionComments(String softwareVersionComments)
softwareVersionComments -
public void setPreferredCipherSC(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred cipher for the Server->Client stream.
Use the static fields available within this class (or the com.sshtools.cipher classes) to identify the correct cipher.
context.setPreferredCipherSC(ConfigurationContext.CIPHER_BLOWFISH_CBC);
name -
IOException
com.maverick.ssh.SshExceptionpublic com.maverick.ssh.components.ComponentFactory supportedMacsCS()
Get the supported message authentication algorithms.
There are no optional MAC algorithms currently available and this method is supplied in preperation for future enhancements.
public com.maverick.ssh.components.ComponentFactory supportedMacsSC()
public String getPreferredMacCS()
public void setPreferredMacCS(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred MAC for the Client->Server stream.
Use the static fields available within this class to identify the correct MAC.
context.setPreferredMacCS(ConfigurationContext.HMAC_MD5);
name -
IOException
com.maverick.ssh.SshExceptionpublic String getPreferredMacSC()
public void setRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel)
killTunnelsOnRemoteForwardingCancel - booleanpublic boolean getRemoteForwardingCancelKillsTunnels()
public int getMaximumPublicKeyVerificationAttempts()
public void setMaximumPublicKeyVerificationAttempts(int maximumPublicKeyVerificationAttempts)
maximumPublicKeyVerificationAttempts - int
public void setPreferredMacSC(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred mac for the Server->Client stream.
Use the static fields available within this class to identify the correct MAC.
context.setPreferredMacCS(ConfigurationContext.HMAC_MD5);
name -
IOException
com.maverick.ssh.SshExceptionpublic com.maverick.ssh.components.ComponentFactory supportedCompressionsCS()
Get the supported compression algorithms.
There are no optional compression algorithms currently available and this method is supplied in preperation for future enhancements.
public com.maverick.ssh.components.ComponentFactory supportedCompressionsSC()
public String getPreferredCompressionCS()
public void setPreferredCompressionCS(String name)
throws IOException
Set the preferred compression for the Client->Server stream.
It is recommended that you do not set the preferred compression so that the client has control over the compression selection.
name -
IOExceptionpublic String getPreferredCompressionSC()
public void setPreferredCompressionSC(String name)
throws IOException
Set the preferred compression for the Server->Client stream.
It is recommended that you do not set the preferred compression so that the client has control over the compression selection.
name -
IOExceptionpublic com.maverick.ssh.components.ComponentFactory supportedKeyExchanges()
Get the supported key exchange methods.
There are no optional key exchange algorithms currently available and this method is supplied in preperation for future enhancements.
public String getPreferredKeyExchange()
public void setPreferredKeyExchange(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred key exchange method.
There is only one supported key exchange algorithm and as such this method is supplied in preperation for future enhancements.
name -
IOException
com.maverick.ssh.SshExceptionpublic String getPreferredPublicKey()
public String getSupportedPublicKeys()
public void setPreferredPublicKey(String name)
throws IOException,
com.maverick.ssh.SshException
Set the preferred public key algorithm.
This value must be one of the installed public key algorithm names.
You will be able to obtain these from the public keys that you installed using ??????
and an example of how to do this is provided in the
ConfigurationContext#addHostKey(SshKeyPair) method description.
name -
IOException
com.maverick.ssh.SshExceptionpublic com.maverick.ssh.components.SshKeyPair[] getHostKeys()
public com.maverick.ssh.components.SshKeyPair getHostKey(String algorithm)
throws IOException
algorithm -
IOException
public void addHostKey(com.maverick.ssh.components.SshKeyPair keyPair)
throws IOException
Add a host key to the configuration.
A host key provides a mechanism for a client to authenticate the server. If the client knows the public key of the server it can validate the signature that the server generated using its private key with the known public key of the server. In order for your server to operate you need to generate and install at least one host key.
It is now recommended to use the
SshDaemon#loadOrGenerateHostKey(File, String, int, ConfigurationContext)
method for generating and loading a host key.
keyPair -
IOExceptionpublic boolean hasPublicKey(String algorithm)
algorithm -
public com.maverick.ssh.components.ComponentFactory supportedAuthenticationMechanisms()
Get the supported authentication mechanisms.
If you have implemented your own AuthenticationMechanism you can
add it to the factory object returned by this method.
context.supportedAuthenticationMechanisms().add("secureID", SecureIDAuthentication.class);
public void setAuthenticationProvider(AuthenticationProvider authenticationProvider)
Set the AuthenticationProvider for
this SSHD instance.
authenticationProvider - public AuthenticationProvider getAuthenticationProvider()
AuthenticationProvider for
this SSHD instance.
public void setFileSystemFactory(FileSystemFactory filesystemFactory)
Set the FileSystem for this SSHD
instance.
This uses a class object rather so that the server can manage the creation of instances of this class.
filesystemProvider - public FileSystemFactory getFileSystemProvider()
FileSystem for this SSHD
instance.
public String getDefaultTerminal()
Get the default terminal to execute when the user requests to start a shell.
This setting is not used explicitly by the server but is available from
the context so that a session implementation can obtain it through the
protected ConnectionProtocol instance.
public void setDefaultTerminal(String defaultTerminal)
Set the default terminal to execute when the user requests to start a shell.
This setting is not used explicitly by the server but is available from
the context so that a session implementation can obtain it through the
protected ConnectionProtocol instance.
defaultTerminal - public com.maverick.ssh.components.ComponentFactory supportedChannels()
Get the supported Channel's for this SSHD
instance.
If you have implemented a custom channel you can use the factory object returned by this method to install the channel.
context.supportedChannels().add("mychannel", MyChannel.class);
public com.maverick.ssh.components.ComponentFactory supportedCommands()
ExecutableCommand's
for this context.
public com.maverick.ssh.components.ComponentFactory supportedSubsystems()
Get the supported Subsystem's for this SSHD
instance.
If you have implemented a custom subsystem you can use the factory object returned by this method to install the new subsystem.
context.supportedSubsystems().add("mysubsystem", MySubsystem.class);
public void setCompressionLevel(int compressionLevel)
compressionLevel - intpublic int getCompressionLevel()
public void setAllowDeniedKEX(boolean allowKeyExchangeForDeniedConnection)
public void setRequiredAuthenticationMethods(int authmethods)
public boolean getAllowDeniedKEX()
public int getMaximumSocketsBacklogPerRemotelyForwardedConnection()
public void setMaximumSocketsBacklogPerRemotelyForwardedConnection(int maximumSocketsBacklogPerRemotelyForwardedConnection)
public String getTooManyConnectionsText()
public void setTooManyConnectionsText(String tooManyConnectionsText)
public String getCiphersSC()
public String getCiphersCS()
public String getMacsCS()
public String getMacsSC()
public String getPublicKeys()
public String getKeyExchanges()
public void setPreferredCipherSC(int[] order)
throws com.maverick.ssh.SshException
order - , list of indices to be moved to the top.
com.maverick.ssh.SshException
public void setPreferredCipherCS(int[] order)
throws com.maverick.ssh.SshException
order - , list of indices to be moved to the top.
com.maverick.ssh.SshException
public void setPreferredMacSC(int[] order)
throws com.maverick.ssh.SshException
order - , list of indices to be moved to the top.
com.maverick.ssh.SshException
public void setPreferredMacCS(int[] order)
throws com.maverick.ssh.SshException
order - , list of indices to be moved to the top.
com.maverick.ssh.SshException
public void setCipherPreferredPositionCS(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshException
public void setCipherPreferredPositionSC(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshException
public void setMacPreferredPositionSC(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshException
public void setMacPreferredPositionCS(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshException
public void setPublicKeyPreferredPosition(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshException
public void setKeyExchangePreferredPosition(String name,
int position)
throws com.maverick.ssh.SshException
com.maverick.ssh.SshExceptionpublic void setForwardingCallback(ForwardingCallback forwardingCallback)
forwardingCallback - NNForwardingCallbackpublic ForwardingCallback getForwardingCallback()
public void setMaximumPacketLength(int maximumPacketLength)
maximumPacketLength - intpublic int getMaximumPacketLength()
public void setKeyExchangeTransferLimit(int MAX_NUM_BYTES_BEFORE_REKEY)
MAX_NUM_BYTES_BEFORE_REKEY - intpublic void setKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY)
MAX_NUM_PACKETS_BEFORE_REKEY - intpublic int getKeyExchangeTransferLimit()
public int getKeyExchangePacketLimit()
public int getIdleConnectionTimeoutSeconds()
public void setIdleConnectionTimeoutSeconds(int idleConnectionTimeout)
idleConnectionTimeout - public KeyboardInteractiveProviderFactory getKeyboardInteractiveProviderFactory()
public void setKeyboardInteractiveProvider(KeyboardInteractiveProviderFactory kbiFactory)
KeyboardInteractiveProvider
keyboardInteractiveProvider - TODO: Convert to use a factory for possible session by session
configuration of keyboardpublic com.maverick.ssh.components.ComponentFactory supportedPublicKeys()
public int getKeepAliveInterval()
public void setKeepAliveInterval(int keepAliveInterval)
keepAliveInterval - public int getKeepAliveDataMaxLength()
public void setKeepAliveDataMaxLength(int keepAliveDataMaxLength)
keepAliveDataMaxLength -
public Object clone()
throws CloneNotSupportedException
clone in class ProtocolContextCloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||