com.maverick.sshd
Class SshContext

java.lang.Object
  extended by com.maverick.nio.ProtocolContext
      extended by com.maverick.sshd.SshContext

public class SshContext
extends ProtocolContext

This class defines an SSH context for listening interfaces on the Daemon.

Author:
Lee David Painter

Field Summary
 
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(ServerComponentManager componentManager)
           
 
Method Summary
 void addHostKey(com.maverick.ssh.components.SshKeyPair keyPair)
          Add a host key to the configuration.
 boolean getAllowDeniedKEX()
           
 AuthenticationPolicy getAllowedAuthentications()
           
 AuthenticationMechanismFactory getAuthenticationMechanismFactory()
           
 String getBannerMessage()
          Get the authentication banner to display to connecting clients.
 ChannelFactory getChannelFactory()
           
 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.
 ServerComponentManager getComponentManager()
           
 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.
 ForwardingManager getForwardingManager()
           
 GlobalRequestFactory getGlobalRequestFactory()
           
 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()
          Should the connection be disconnected on session timeout?
 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.
 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.
 ForwardingPolicy getLocalForwardingPolicy()
           
 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()
           
 int getMaxSFTPVersion()
           
 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.
 boolean getRemoteForwardingCancelKillsTunnels()
          Determines whether the cancellation of a remote forwarding drops currently active tunnels
 ForwardingPolicy getRemoteForwardingPolicy()
           
 AuthenticationPolicy getRequiredAuthentications()
           
 int getSessionTimeout()
          Returns the session timeout in seconds
 String getSFTPCharsetEncoding()
          Get the current encoding value for filenames in SFTP sessions.
 ShellPolicy getShellPolicy()
           
 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 setAllowDeniedKEX(boolean allowKeyExchangeForDeniedConnection)
           
 void setAllowedAuthentications(AuthenticationPolicy allowedAuthentications)
           
 void setAuthenicationMechanismFactory(AuthenticationMechanismFactory authFactory)
           
 void setBannerMessage(String authenticationBanner)
          Set the banner message that is displayed to all connecing clients prior to authentication.
 void setChannelFactory(ChannelFactory channelFactory)
           
 void setChannelLimit(int maxChannels)
          Set the maximum number of open channels allowed by each client (defaults to 100).
 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 setForwardingManager(ForwardingManager remoteForwardingManager)
           
 void setGlobalRequestFactory(GlobalRequestFactory globalRequestFactory)
           
 void setIdleConnectionTimeoutSeconds(int idleConnectionTimeout)
          Inform the context that the connection should be disconnected on session timeout
 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 setKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY)
          This tells the server how many packets to use before a key exchange.
 void setKeyExchangeTransferLimit(int MAX_NUM_BYTES_BEFORE_REKEY)
          This limit tells the server when to force a key exchange.
 void setLocalForwardingPolicy(ForwardingPolicy localForwardingPolicy)
           
 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 setMaxSFTPVersion(int maxSftpVersion)
           
 void setPreferredCipherCS(String name)
           Set the preferred cipher for the Client->Server stream.
 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(String name)
           Set the preferred MAC for the Client->Server stream.
 void setPreferredMacSC(String name)
           Set the preferred mac for the Server->Client stream.
 void setPreferredPublicKey(String name)
           Set the preferred public key algorithm.
 void setRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel)
          When the user cancels a remote forwarding should active tunnels be dropped?
 void setRemoteForwardingPolicy(ForwardingPolicy remoteForwardingPolicy)
           
 void setRequiredAuthentications(AuthenticationPolicy requiredAuthentications)
           
 void setSessionTimeout(int sessionTimeoutSeconds)
          Sets the session timeout in seconds
 void setSFTPCharsetEncoding(String sftpCharsetEncoding)
          Set the default encoding for filenames in SFTP sessions.
 void setShellPolicy(ShellPolicy permissions)
           
 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<com.maverick.ssh.components.SshCipher> supportedCiphersCS()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCipher> supportedCiphersSC()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCompression> supportedCompressionsCS()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCompression> supportedCompressionsSC()
           
 com.maverick.ssh.components.ComponentFactory<SshKeyExchangeServer> supportedKeyExchanges()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshHmac> supportedMacsCS()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshHmac> supportedMacsSC()
           
 com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshPublicKey> supportedPublicKeys()
           
 
Methods inherited from class com.maverick.nio.ProtocolContext
getReceiveBufferSize, getSendBufferSize, getSocketOptionKeepAlive, getSocketOptionReuseAddress, getSocketOptionTcpNoDelay, setReceiveBufferSize, setSendBufferSize, setSocketOptionKeepAlive, setSocketOptionReuseAddress, setSocketOptionTcpNoDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshContext

public SshContext()
           throws IOException,
                  com.maverick.ssh.SshException
Constructs a default context but does not set the daemon

Throws:
IOException
com.maverick.ssh.SshException

SshContext

public SshContext(ServerComponentManager componentManager)
           throws IOException,
                  com.maverick.ssh.SshException
Throws:
IOException
com.maverick.ssh.SshException
Method Detail

getComponentManager

public ServerComponentManager getComponentManager()

getShellPolicy

public ShellPolicy getShellPolicy()

setShellPolicy

public void setShellPolicy(ShellPolicy permissions)

getChannelFactory

public ChannelFactory getChannelFactory()

setChannelFactory

public void setChannelFactory(ChannelFactory channelFactory)

getGlobalRequestFactory

public GlobalRequestFactory getGlobalRequestFactory()

setGlobalRequestFactory

public void setGlobalRequestFactory(GlobalRequestFactory globalRequestFactory)

getForwardingManager

public ForwardingManager getForwardingManager()

setForwardingManager

public void setForwardingManager(ForwardingManager remoteForwardingManager)

getAllowedAuthentications

public AuthenticationPolicy getAllowedAuthentications()

setAllowedAuthentications

public void setAllowedAuthentications(AuthenticationPolicy allowedAuthentications)

getRequiredAuthentications

public AuthenticationPolicy getRequiredAuthentications()

setRequiredAuthentications

public void setRequiredAuthentications(AuthenticationPolicy requiredAuthentications)

getRemoteForwardingPolicy

public ForwardingPolicy getRemoteForwardingPolicy()

setRemoteForwardingPolicy

public void setRemoteForwardingPolicy(ForwardingPolicy remoteForwardingPolicy)

getLocalForwardingPolicy

public ForwardingPolicy getLocalForwardingPolicy()

setLocalForwardingPolicy

public void setLocalForwardingPolicy(ForwardingPolicy localForwardingPolicy)

getBannerMessage

public String getBannerMessage()
Get the authentication banner to display to connecting clients.

Returns:
String

getSFTPCharsetEncoding

public String getSFTPCharsetEncoding()
Get the current encoding value for filenames in SFTP sessions.

Returns:
String

getMaxSFTPVersion

public int getMaxSFTPVersion()

setMaxSFTPVersion

public void setMaxSFTPVersion(int maxSftpVersion)

setSFTPCharsetEncoding

public void setSFTPCharsetEncoding(String sftpCharsetEncoding)
Set the default encoding for filenames in SFTP sessions. The default encoding for the currently supported SFTP protocol is ISO-8859-1.

Parameters:
sftpCharsetEncoding - String

getSessionTimeout

public int getSessionTimeout()
Returns the session timeout in seconds

Returns:
int

setSessionTimeout

public void setSessionTimeout(int sessionTimeoutSeconds)
Sets the session timeout in seconds

Parameters:
sessionTimeoutSeconds - int

setChannelLimit

public void setChannelLimit(int maxChannels)
Set the maximum number of open channels allowed by each client (defaults to 100).

Parameters:
maxChannels -

getChannelLimit

public int getChannelLimit()
Get the maximum number of open channels allowed by each client.

Returns:
int

getMaxAuthentications

public int getMaxAuthentications()
Get the maximum number of failed authentications allowed for each connection.

Returns:
int

setMaxAuthentications

public void setMaxAuthentications(int maxAuthentications)
Set the maximum number of failed authentications allowed for each connection.

Parameters:
maxAuthentications -

setMaximumConnections

public void setMaximumConnections(int maximumConnections)
Set the maximum number of connections allowed at any one time.

Parameters:
maximumConnections - int

getMaximumConnections

public int getMaximumConnections()
Get the maximum number of connections allowed at any one time.

Returns:
int

getPreferredCipherCS

public String getPreferredCipherCS()
Get the currently preferred cipher for the Client->Server stream.

Returns:
the preferred Client-Server cipher

setPreferredCipherCS

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);

The default cipher is 3DES

Parameters:
name -
Throws:
IOException - if the cipher is not supported
com.maverick.ssh.SshException

setBannerMessage

public void setBannerMessage(String authenticationBanner)
Set the banner message that is displayed to all connecing clients prior to authentication. If this method is used then com.maverick.sshd.NoneAuthentication.getBannerForUser(String) should not be overridden.

Parameters:
authenticationBanner -

getPreferredCipherSC

public String getPreferredCipherSC()
Get the currently preferred cipher for the Server->Client stream.

Returns:
the preferred Server-Client cipher

getSoftwareVersionComments

public String getSoftwareVersionComments()
Get the software/version/comments field that is to be used in the SSH protocols negotiation procedure.

Returns:
String

setSoftwareVersionComments

public void setSoftwareVersionComments(String softwareVersionComments)
Set the current implementations software/version/comments field that is used during the SSH protocols negotiation procedure. This value MUST consist of printable US-ASCII characters with the exception of whitespace and the minus sign (-) and be no longer than 200 characters.

Parameters:
softwareVersionComments -

setPreferredCipherSC

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);

The default cipher is 3DES

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredMacCS

public String getPreferredMacCS()
Get the currently preferred mac for the Client->Server stream.

Returns:
the preferred Client-Server mac

setPreferredMacCS

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);

The default MAC is HMAC_SHA1

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredMacSC

public String getPreferredMacSC()
Get the currently supported mac for the Server-Client stream.

Returns:
the preferred Server-Client mac

setRemoteForwardingCancelKillsTunnels

public void setRemoteForwardingCancelKillsTunnels(boolean killTunnelsOnRemoteForwardingCancel)
When the user cancels a remote forwarding should active tunnels be dropped?

Parameters:
killTunnelsOnRemoteForwardingCancel - boolean

getRemoteForwardingCancelKillsTunnels

public boolean getRemoteForwardingCancelKillsTunnels()
Determines whether the cancellation of a remote forwarding drops currently active tunnels

Returns:
boolean

getMaximumPublicKeyVerificationAttempts

public int getMaximumPublicKeyVerificationAttempts()
Get the number of public keys that each user can attempt to verify for public key authentication. If the user exceeds this limit the connection is terminated.

Returns:
int

setMaximumPublicKeyVerificationAttempts

public void setMaximumPublicKeyVerificationAttempts(int maximumPublicKeyVerificationAttempts)
Set the number of public keys that a user can verify for public key authentication. If the user exceeds this limit the connection is terminated.

Parameters:
maximumPublicKeyVerificationAttempts - int

setPreferredMacSC

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);

The default MAC is HMAC_SHA1

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredCompressionCS

public String getPreferredCompressionCS()
Get the currently preferred compression for the Client->Server stream.

Returns:
the preferred Client-Server compression

setPreferredCompressionCS

public void setPreferredCompressionCS(String name)
                               throws IOException,
                                      com.maverick.ssh.SshException

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.

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredCompressionSC

public String getPreferredCompressionSC()
Get the currently preferred compression for the Server->Client stream.

Returns:
the preferred Server->Client compression

setPreferredCompressionSC

public void setPreferredCompressionSC(String name)
                               throws IOException,
                                      com.maverick.ssh.SshException

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.

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredKeyExchange

public String getPreferredKeyExchange()
Get the currently preferred key exchange method.

Returns:
the preferred key exhcange

setPreferredKeyExchange

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.

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getPreferredPublicKey

public String getPreferredPublicKey()
Get the currently preferred public key algorithm.

Returns:
the preferred public key

getSupportedPublicKeys

public String getSupportedPublicKeys()
Returns a comma delimited string containing installed public key types.

Returns:
String

setPreferredPublicKey

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.

Parameters:
name -
Throws:
IOException
com.maverick.ssh.SshException

getHostKeys

public com.maverick.ssh.components.SshKeyPair[] getHostKeys()
Get all the hosts keys.

Returns:
SshPublicKey[]

getHostKey

public com.maverick.ssh.components.SshKeyPair getHostKey(String algorithm)
                                                  throws IOException
Get the SSHD host key for a given algorithm.

Parameters:
algorithm -
Returns:
SshKeyPair
Throws:
IOException

addHostKey

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.

Parameters:
keyPair -
Throws:
IOException

hasPublicKey

public boolean hasPublicKey(String algorithm)
Determine if the server has a host key configured.

Parameters:
algorithm -
Returns:
boolean

getAuthenticationMechanismFactory

public AuthenticationMechanismFactory getAuthenticationMechanismFactory()

setAuthenicationMechanismFactory

public void setAuthenicationMechanismFactory(AuthenticationMechanismFactory authFactory)

setFileSystemFactory

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.

Parameters:
filesystemProvider -

getFileSystemProvider

public FileSystemFactory getFileSystemProvider()
Get the FileSystem for this SSHD instance.

Returns:
Class

getDefaultTerminal

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.

Returns:
String

setDefaultTerminal

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.

Parameters:
defaultTerminal -

setCompressionLevel

public void setCompressionLevel(int compressionLevel)
Set the compression level to use if compression is enabled

Parameters:
compressionLevel - int

getCompressionLevel

public int getCompressionLevel()
Get the current compression level

Returns:
int

setAllowDeniedKEX

public void setAllowDeniedKEX(boolean allowKeyExchangeForDeniedConnection)

getAllowDeniedKEX

public boolean getAllowDeniedKEX()

getMaximumSocketsBacklogPerRemotelyForwardedConnection

public int getMaximumSocketsBacklogPerRemotelyForwardedConnection()

setMaximumSocketsBacklogPerRemotelyForwardedConnection

public void setMaximumSocketsBacklogPerRemotelyForwardedConnection(int maximumSocketsBacklogPerRemotelyForwardedConnection)

getTooManyConnectionsText

public String getTooManyConnectionsText()

setTooManyConnectionsText

public void setTooManyConnectionsText(String tooManyConnectionsText)

getCiphersSC

public String getCiphersSC()
Get the ciphers for the Server->Client stream.

Returns:
the Server-Client ciphers in order of preference

getCiphersCS

public String getCiphersCS()

getMacsCS

public String getMacsCS()
Get the ciphers for the Client->Server stream.

Returns:
the Client-Server ciphers in order of preference

getMacsSC

public String getMacsSC()
Get the ciphers for the Server->Client stream.

Returns:
the Server-Client ciphers in order of preference

getPublicKeys

public String getPublicKeys()
Get the ciphers for the Server->Client stream.

Returns:
the Server-Client ciphers in order of preference

getKeyExchanges

public String getKeyExchanges()
Get the ciphers for the Server->Client stream.

Returns:
the Server-Client ciphers in order of preference

setMaximumPacketLength

public void setMaximumPacketLength(int maximumPacketLength)
Set the maximum supported length of an SSH packet.

Parameters:
maximumPacketLength - int

getMaximumPacketLength

public int getMaximumPacketLength()
Get the maximum supported length of an SSH packet.

Returns:
int

setKeyExchangeTransferLimit

public void setKeyExchangeTransferLimit(int MAX_NUM_BYTES_BEFORE_REKEY)
This limit tells the server when to force a key exchange.

Parameters:
MAX_NUM_BYTES_BEFORE_REKEY - int

setKeyExchangePacketLimit

public void setKeyExchangePacketLimit(int MAX_NUM_PACKETS_BEFORE_REKEY)
This tells the server how many packets to use before a key exchange.

Parameters:
MAX_NUM_PACKETS_BEFORE_REKEY - int

getKeyExchangeTransferLimit

public int getKeyExchangeTransferLimit()
Get the number of bytes to transfer before a key exchange is forced.

Returns:
int

getKeyExchangePacketLimit

public int getKeyExchangePacketLimit()
Get the number of packets to send before a key exchange is forced

Returns:
int

getIdleConnectionTimeoutSeconds

public int getIdleConnectionTimeoutSeconds()
Should the connection be disconnected on session timeout?

Returns:

setIdleConnectionTimeoutSeconds

public void setIdleConnectionTimeoutSeconds(int idleConnectionTimeout)
Inform the context that the connection should be disconnected on session timeout

Parameters:
idleConnectionTimeout -

supportedPublicKeys

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshPublicKey> supportedPublicKeys()

getKeepAliveInterval

public int getKeepAliveInterval()
Get the current keep-alive interval (in seconds). The server sends an SSH_MSG_IGNORE every n seconds after no activity on a connection.

Returns:

setKeepAliveInterval

public void setKeepAliveInterval(int keepAliveInterval)
Set the keep-alive interval (in seconds). The server sends an SSH_MSG_IGNORE message every n seconds after no activity on a connection.

Parameters:
keepAliveInterval -

getKeepAliveDataMaxLength

public int getKeepAliveDataMaxLength()
Get the maximum data length for the keep-alive packet.

Returns:

setKeepAliveDataMaxLength

public void setKeepAliveDataMaxLength(int keepAliveDataMaxLength)
Set the maximum data length for the keep-alive packet. Default is 128, the actual number of bytes is random up to this maximum.

Parameters:
keepAliveDataMaxLength -

getKerberosRealm

public String getKerberosRealm()
Get the realm name to use for GSSAPI Kerberos authentication. The realm should be in UPPER case, for example EXAMPLE.COM. This is not used if a custom Configuration has been set using setKerberosConfiguration(Configuration).

Returns:
kerberos realm

setKerberosRealm

public void setKerberosRealm(String kerberosRealm)
Set the realm name to use for GSSAPI Kerberos authentication. The realm should be in UPPER case, for example EXAMPLE.COM.

Parameters:
kerberosRealm - kerberos realm

getKerberosDC

public String getKerberosDC()
Get the Kerberos domain controller address . This may be a hostname or IP address.

Returns:
kerberos domain controller

setKerberosDC

public void setKerberosDC(String kerberosDC)
Set the Kerberos domain controller address . This may be a hostname or IP address.

Parameters:
kerberosDC - kerberos domain controller

getKerberosServicePassword

public char[] getKerberosServicePassword()
Get the Kerberos service account password. By default, this will only be needed if the service does not already have a valid ticket in the keytab.

Returns:
kerberos service password

setKerberosServicePassword

public void setKerberosServicePassword(char[] kerberosServicePassword)
Set the Kerberos service account password. By default, this will only be needed if the service does not already have a valid ticket in the keytab.

Parameters:
kerberosServicePassword - param kerberos service account password

getKerberosServicePrincipal

public String getKerberosServicePrincipal()
Get the Kerberos service account password. By default, this will only be needed if the service does not already have a valid ticket in the keytab. This is not used if a custom Configuration has been set using setKerberosConfiguration(Configuration).

Returns:

setKerberosServicePrincipal

public void setKerberosServicePrincipal(String kerberosServicePrincipal)
Set the Kerberos service account princial. By default, this will only be needed if the service does not already have a valid ticket in the keytab or if there is more than one. This is not used if a custom Configuration has been set using setKerberosConfiguration(Configuration).

Parameters:
kerberosServicePrincipal - kerberos service account principal

getKerberosConfiguration

public Configuration getKerberosConfiguration()
Get the custom Kerberos configuration. By default this will return null.

Returns:
kerberos configuration

setKerberosConfiguration

public void setKerberosConfiguration(Configuration kerberosConfiguration)
Set the custom Kerberos configuration. By default this will return null.

Parameters:
kerberosConfiguration - kerberos configuration

supportedKeyExchanges

public com.maverick.ssh.components.ComponentFactory<SshKeyExchangeServer> supportedKeyExchanges()

supportedCiphersCS

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCipher> supportedCiphersCS()

supportedCiphersSC

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCipher> supportedCiphersSC()

supportedMacsCS

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshHmac> supportedMacsCS()

supportedMacsSC

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshHmac> supportedMacsSC()

supportedCompressionsCS

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCompression> supportedCompressionsCS()

supportedCompressionsSC

public com.maverick.ssh.components.ComponentFactory<com.maverick.ssh.components.SshCompression> supportedCompressionsSC()


Copyright © 2012. All Rights Reserved.