Package org.apache.sshd.server.session
Class AbstractServerSession
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.util.closeable.IoBaseCloseable
org.apache.sshd.common.util.closeable.AbstractCloseable
org.apache.sshd.common.util.closeable.AbstractInnerCloseable
org.apache.sshd.common.kex.AbstractKexFactoryManager
org.apache.sshd.common.session.helpers.SessionHelper
org.apache.sshd.common.session.helpers.AbstractSession
org.apache.sshd.server.session.AbstractServerSession
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,AttributeRepository,AttributeStore,MutableUserHolder,UserAuthFactoriesManager<ServerSession,,UserAuth, UserAuthFactory> UsernameHolder,ChannelListenerManager,ChannelStreamWriterResolver,ChannelStreamWriterResolverManager,Closeable,FactoryManagerHolder,PortForwardingEventListenerManager,PortForwardingInformationProvider,KexExtensionHandlerManager,KexFactoryManager,KeyPairProviderHolder,PropertyResolver,ReservedSessionMessagesManager,Session,SessionContext,SessionDisconnectHandlerManager,SessionHeartbeatController,SessionListenerManager,UnknownChannelReferenceHandlerManager,SignatureFactoriesHolder,SignatureFactoriesManager,ConnectionEndpointsIndicator,ServerAuthenticationManager,ServerProxyAcceptorHolder,ServerSession
- Direct Known Subclasses:
ServerSessionImpl
Provides default implementations for
ServerSession related methods-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.session.helpers.AbstractSession
AbstractSession.MessageCodingSettingsNested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.StateNested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T>Nested classes/interfaces inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
SessionHeartbeatController.HeartbeatType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SocketAddressprivate GSSAuthenticatorprivate HostBasedAuthenticatorprivate HostKeyCertificateProviderprivate KeyboardInteractiveAuthenticatorprivate KeyPairProviderprivate PasswordAuthenticatorprivate ServerProxyAcceptorprivate PublickeyAuthenticatorprivate List<UserAuthFactory> Fields inherited from class org.apache.sshd.common.session.helpers.AbstractSession
channelListenerProxy, channelListeners, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, firstKexPacketFollows, ignorePacketDataLength, ignorePacketsCount, ignorePacketsFrequency, ignorePacketsVariance, inBlocksCount, inBytesCount, inCipher, inCipherSize, inCompression, initialKexDone, initialKexInitSequenceNumber, inMac, inMacResult, inMacSize, inPacketsCount, inSettings, kex, kexFutureHolder, kexHandler, kexInitializedFuture, kexState, lastKeyTimeValue, maxRekeyBlocks, maxRekeyBytes, maxRekeyInterval, maxRekyPackets, negotiationResult, outBlocksCount, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outMacSize, outPacketsCount, outSettings, random, requestLock, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, sessionListeners, strictKex, tunnelListenerProxy, tunnelListeners, uncompressBuffer, unmodClientProposal, unmodNegotiationResult, unmodServerProposalFields inherited from class org.apache.sshd.common.session.helpers.SessionHelper
authStart, idleStart, initialKexProposalFields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, stateFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolver
NONEFields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTYFields inherited from interface org.apache.sshd.server.ServerAuthenticationManager
DEFAULT_USER_AUTH_GSS_FACTORY, DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY, DEFAULT_USER_AUTH_PASSWORD_FACTORY, DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORYFields inherited from interface org.apache.sshd.common.session.SessionContext
DEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractServerSession(ServerFactoryManager factoryManager, IoSession ioSession) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidIndicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify the server's keyintgetActiveSessionCountForUser(String userName) Retrieve the current number of sessions active for a given username.protected ConnectionServiceRetrieve theGSSAuthenticatorto be used by the SSH server.Retrieve theHostBasedAuthenticatorto be used by the SSH server.longgetId()Retrieve theKeyboardInteractiveAuthenticatorto be used by the SSH server.Retrieve theKeyPairProviderthat will be used to find the host key to use on the server side or the user key on the client side.Retrieve thePasswordAuthenticatorto be used by the SSH server.Retrieve thePublickeyAuthenticatorto be used by SSH server.Retrieve the list of named factories forUserAuthobjects.protected voidhandleServiceAccept(String serviceName, Buffer buffer) protected booleanhandleServiceRequest(String serviceName, Buffer buffer) protected booleanreadIdentification(Buffer buffer) Read the other side identification.protected voidreceiveKexInit(Map<KexProposalOption, String> proposal, byte[] seed) protected StringresolveAvailableSignaturesProposal(FactoryManager proposedManager) Computes the list of available host key signature algorithms supported.protected StringresolveEmptySignaturesProposal(Iterable<String> supported, Iterable<String> provided) Called byresolveAvailableSignaturesProposal(FactoryManager)if none of the provided keys is supported - last chance for the derived implementation to do somethingprotected byte[]sendKexInit(Map<KexProposalOption, String> proposal) Send the key exchange initialization packet.protected IoWriteFuturesendServerIdentification(List<String> headerLines) Sends the server identification + any extra header linesvoidsetClientAddress(SocketAddress clientAddress) voidsetGSSAuthenticator(GSSAuthenticator gssAuthenticator) voidsetHostBasedAuthenticator(HostBasedAuthenticator hostBasedAuthenticator) voidsetHostKeyCertificateProvider(HostKeyCertificateProvider hostKeyCertificateProvider) protected voidsetKexSeed(byte... seed) voidsetKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator interactiveAuthenticator) voidsetKeyPairProvider(KeyPairProvider keyPairProvider) voidsetPasswordAuthenticator(PasswordAuthenticator passwordAuthenticator) voidsetPublickeyAuthenticator(PublickeyAuthenticator publickeyAuthenticator) voidsetServerProxyAcceptor(ServerProxyAcceptor proxyAcceptor) voidsetUserAuthFactories(List<UserAuthFactory> userAuthFactories) signalAuthenticationSuccess(String username, String authService, Buffer buffer) voidstartService(String name, Buffer buffer) Methods inherited from class org.apache.sshd.common.session.helpers.AbstractSession
addChannelListener, addPortForwardingEventListener, addSessionListener, aeadOutgoingBuffer, appendOutgoingMac, attachSession, calculatePadLength, checkRekey, comparePreferredKexProposalOption, createBuffer, decode, determineRekeyBlockLimit, doHandleMessage, doInvokeUnimplementedMessageHandler, doKexNegotiation, doStrictKexProposal, doWritePacket, encode, encryptOutgoingBuffer, failStrictKex, getChannelListenerProxy, getCipherInformation, getClientKexData, getClientKexProposals, getClientVersion, getCompressionInformation, getInnerCloseable, getKex, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getPortForwardingEventListenerProxy, getServerKexData, getServerKexProposals, getServerVersion, getService, getServices, getSession, getSession, getSessionId, getSessionListenerProxy, handleFirstKexPacketFollows, handleKexExtension, handleKexInit, handleKexMessage, handleMessage, handleNewCompression, handleNewKeys, handleServiceAccept, handleServiceRequest, initializeCurrentService, initializeKeyExchangeMessageHandler, isRekeyBlocksCountExceeded, isRekeyDataSizeExceeded, isRekeyPacketCountsExceeded, isRekeyRequired, isRekeyTimeIntervalExceeded, messageReceived, negotiate, notImplemented, preClose, prepareBuffer, prepareNewKeys, preProcessEncodeBuffer, receiveKexInit, receiveKexInit, reExchangeKeys, refreshConfiguration, removeChannelListener, removePortForwardingEventListener, removeSessionListener, removeValue, request, request, requestFailure, requestNewKeysExchange, requestSuccess, resolveIgnoreBufferDataLength, resolveOutputPacket, resolveSessionKexProposal, sendKexInit, sendNewKeys, setClientKexData, setInputEncoding, setNegotiationResult, setOutputEncoding, setServerKexData, validateIncomingMac, validateKexState, validateServiceKexState, validateTargetBuffer, writePacket, writePacketMethods inherited from class org.apache.sshd.common.session.helpers.SessionHelper
attributeKeys, calculateNextIgnorePacketCount, checkAuthenticationTimeout, checkForTimeouts, checkIdleTimeout, clearAttributes, computeAttributeIfAbsent, createProposal, disconnect, doInvokeDebugMessageHandler, doInvokeIgnoreMessageHandler, doReadIdentification, exceptionCaught, getAttribute, getAttributesCount, getAuthTimeout, getAuthTimeoutStart, getBoundLocalPortForwards, getBoundRemotePortForward, getChannelStreamWriterResolver, getForwarder, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKexProposal, getLocalForwardsBindings, getParentPropertyResolver, getProperties, getRemoteForwardsBindings, getReservedSessionMessagesHandler, getSessionDisconnectHandler, getStartedLocalPortForwards, getStartedRemotePortForwards, getTimeoutStatus, getUnknownChannelReferenceHandler, getUsername, handleDebug, handleDisconnect, handleDisconnect, handleIgnore, handleUnimplemented, invokeSessionSignaller, isAuthenticated, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort, isServerSession, mergeProposals, removeAttribute, resetAuthTimeout, resetIdleTimeout, resizeKey, resolveAvailableSignaturesProposal, resolveChannelStreamWriterResolver, resolveIdentificationString, resolvePeerAddress, resolveReservedSessionMessagesHandler, resolveUnknownChannelReferenceHandler, sendDebugMessage, sendIdentification, sendIgnoreMessage, sendNotImplemented, setAttribute, setAuthenticated, setChannelStreamWriterResolver, setReservedSessionMessagesHandler, setSessionDisconnectHandler, setUnknownChannelReferenceHandler, setUsername, signalDisconnect, signalDisconnect, signalExceptionCaught, signalExceptionCaught, signalNegotiationEnd, signalNegotiationEnd, signalNegotiationOptionsCreated, signalNegotiationOptionsCreated, signalNegotiationStart, signalNegotiationStart, signalPeerIdentificationReceived, signalPeerIdentificationReceived, signalReadPeerIdentificationLine, signalReadPeerIdentificationLine, signalSendIdentification, signalSendIdentification, signalSessionClosed, signalSessionClosed, signalSessionCreated, signalSessionCreated, signalSessionEstablished, signalSessionEstablished, signalSessionEvent, signalSessionEvent, toStringMethods inherited from class org.apache.sshd.common.kex.AbstractKexFactoryManager
getCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactoriesMethods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediatelyMethods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListenerMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.AttributeRepository
attributeKeys, getAttribute, getAttributesCountMethods inherited from interface org.apache.sshd.common.AttributeStore
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttributeMethods inherited from interface org.apache.sshd.common.channel.ChannelListenerManager
addChannelListener, getChannelListenerProxy, removeChannelListenerMethods inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolverManager
getChannelStreamWriterResolver, resolveChannelStreamWriter, resolveChannelStreamWriterResolver, setChannelStreamWriterResolverMethods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListenerMethods inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandlerManager
getKexExtensionHandler, setKexExtensionHandlerMethods inherited from interface org.apache.sshd.common.kex.KexFactoryManager
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNamesMethods inherited from interface org.apache.sshd.common.auth.MutableUserHolder
setUsernameMethods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListenerManager
addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListenerMethods inherited from interface org.apache.sshd.common.forward.PortForwardingInformationProvider
getBoundLocalPortForwards, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPortMethods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty, isEmptyMethods inherited from interface org.apache.sshd.common.session.ReservedSessionMessagesManager
getReservedSessionMessagesHandler, setReservedSessionMessagesHandlerMethods inherited from interface org.apache.sshd.server.ServerAuthenticationManager
setUserAuthFactoriesNamesMethods inherited from interface org.apache.sshd.common.session.Session
createBuffer, createBuffer, disconnect, exceptionCaught, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, request, request, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, writePacket, writePacket, writePacket, writePacketMethods inherited from interface org.apache.sshd.common.session.SessionContext
getCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isServerSessionMethods inherited from interface org.apache.sshd.common.session.SessionDisconnectHandlerManager
getSessionDisconnectHandler, setSessionDisconnectHandlerMethods inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat, setSessionHeartbeatMethods inherited from interface org.apache.sshd.common.session.SessionListenerManager
addSessionListener, getSessionListenerProxy, removeSessionListenerMethods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesHolder
getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNamesMethods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager
setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNamesMethods inherited from interface org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager
getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandlerMethods inherited from interface org.apache.sshd.common.auth.UserAuthFactoriesManager
getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNamesMethods inherited from interface org.apache.sshd.common.auth.UsernameHolder
getUsername
-
Field Details
-
proxyAcceptor
-
clientAddress
-
passwordAuthenticator
-
publickeyAuthenticator
-
interactiveAuthenticator
-
gssAuthenticator
-
hostBasedAuthenticator
-
userAuthFactories
-
keyPairProvider
-
hostKeyCertificateProvider
-
-
Constructor Details
-
AbstractServerSession
-
-
Method Details
-
getFactoryManager
- Specified by:
getFactoryManagerin interfaceFactoryManagerHolder- Specified by:
getFactoryManagerin interfaceServerSession- Overrides:
getFactoryManagerin classSessionHelper- Returns:
- The currently associated
FactoryManager
-
getServerProxyAcceptor
- Specified by:
getServerProxyAcceptorin interfaceServerProxyAcceptorHolder
-
setServerProxyAcceptor
- Specified by:
setServerProxyAcceptorin interfaceServerProxyAcceptorHolder
-
getClientAddress
- Specified by:
getClientAddressin interfaceServerSession- Returns:
- The
SocketAddressof the remote client. If no proxy wrapping was used then this is the same as theIoSession#getRemoteAddress(). Otherwise, it indicates the real client's address that was somehow transmitted via the proxy meta-data
-
setClientAddress
-
getPasswordAuthenticator
Description copied from interface:ServerAuthenticationManagerRetrieve thePasswordAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on passwords will be rejected.- Specified by:
getPasswordAuthenticatorin interfaceServerAuthenticationManager- Returns:
- the
PasswordAuthenticatorornull
-
setPasswordAuthenticator
- Specified by:
setPasswordAuthenticatorin interfaceServerAuthenticationManager
-
getPublickeyAuthenticator
Description copied from interface:ServerAuthenticationManagerRetrieve thePublickeyAuthenticatorto be used by SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on keys will be rejected.- Specified by:
getPublickeyAuthenticatorin interfaceServerAuthenticationManager- Returns:
- the
PublickeyAuthenticatorornull
-
setPublickeyAuthenticator
- Specified by:
setPublickeyAuthenticatorin interfaceServerAuthenticationManager
-
getKeyboardInteractiveAuthenticator
Description copied from interface:ServerAuthenticationManagerRetrieve theKeyboardInteractiveAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on this method will be rejected.- Specified by:
getKeyboardInteractiveAuthenticatorin interfaceServerAuthenticationManager- Returns:
- The
KeyboardInteractiveAuthenticatorornull
-
setKeyboardInteractiveAuthenticator
public void setKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator interactiveAuthenticator) - Specified by:
setKeyboardInteractiveAuthenticatorin interfaceServerAuthenticationManager
-
getGSSAuthenticator
Description copied from interface:ServerAuthenticationManagerRetrieve theGSSAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on gssapi will be rejected.- Specified by:
getGSSAuthenticatorin interfaceServerAuthenticationManager- Returns:
- the
GSSAuthenticatorornull
-
setGSSAuthenticator
- Specified by:
setGSSAuthenticatorin interfaceServerAuthenticationManager
-
getHostBasedAuthenticator
Description copied from interface:ServerAuthenticationManagerRetrieve theHostBasedAuthenticatorto be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull), then client authentication requests based on this method will be rejected.- Specified by:
getHostBasedAuthenticatorin interfaceServerAuthenticationManager- Returns:
- the
HostBasedAuthenticatorornull
-
setHostBasedAuthenticator
- Specified by:
setHostBasedAuthenticatorin interfaceServerAuthenticationManager
-
getUserAuthFactories
Description copied from interface:UserAuthFactoriesManagerRetrieve the list of named factories forUserAuthobjects.- Specified by:
getUserAuthFactoriesin interfaceUserAuthFactoriesManager<ServerSession,UserAuth, UserAuthFactory> - Returns:
- a list of named
UserAuthfactories, nevernull/empty
-
setUserAuthFactories
- Specified by:
setUserAuthFactoriesin interfaceUserAuthFactoriesManager<ServerSession,UserAuth, UserAuthFactory>
-
getKeyPairProvider
Description copied from interface:KeyPairProviderHolderRetrieve theKeyPairProviderthat will be used to find the host key to use on the server side or the user key on the client side.- Specified by:
getKeyPairProviderin interfaceKeyPairProviderHolder- Returns:
- the
KeyPairProvider, nevernull
-
getHostKeyCertificateProvider
- Specified by:
getHostKeyCertificateProviderin interfaceServerAuthenticationManager- Returns:
- a
HostKeyCertificateProviderif available, null as default
-
setHostKeyCertificateProvider
- Specified by:
setHostKeyCertificateProviderin interfaceServerAuthenticationManager
-
setKeyPairProvider
- Specified by:
setKeyPairProviderin interfaceKeyPairProviderHolder
-
sendServerIdentification
Sends the server identification + any extra header lines- Parameters:
headerLines- Extra header lines to be prepended to the actual identification string - ignored ifnull/empty- Returns:
- An
IoWriteFuturethat can be used to be notified of identification data being written successfully or failing - Throws:
Exception- If failed to send identification- See Also:
-
checkKeys
protected void checkKeys()Description copied from class:AbstractSessionIndicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify the server's key- Specified by:
checkKeysin classAbstractSession
-
handleServiceRequest
- Overrides:
handleServiceRequestin classAbstractSession- Throws:
Exception
-
startService
- Specified by:
startServicein interfaceSession- Parameters:
name- Service namebuffer- Extra information provided when the service start request was received- Throws:
Exception- If failed to start it
-
signalAuthenticationSuccess
public IoWriteFuture signalAuthenticationSuccess(String username, String authService, Buffer buffer) throws Exception Description copied from interface:ServerSession- Marks the session as authenticated.
- Starts the specified service.
- Sends the
SSH_MSG_USERAUTH_SUCCESSmessage.
- Specified by:
signalAuthenticationSuccessin interfaceServerSession- Parameters:
username- The authenticated usernameauthService- The service to startbuffer- Any extra data received to use to start the service- Returns:
- An
IoWriteFuturethat can be used to wait for theSSH_MSG_USERAUTH_SUCCESSmessage send result - Throws:
Exception- if cannot handle the request
-
handleServiceAccept
- Overrides:
handleServiceAcceptin classAbstractSession- Throws:
Exception
-
sendKexInit
Description copied from class:AbstractSessionSend the key exchange initialization packet. This packet contains random data along with our proposal.- Overrides:
sendKexInitin classAbstractSession- Parameters:
proposal- our proposal for key exchange negotiation- Returns:
- the sent packet data which must be kept for later use when deriving the session keys
- Throws:
Exception- if an error occurred sending the packet
-
setKexSeed
protected void setKexSeed(byte... seed) - Specified by:
setKexSeedin classAbstractSession- Parameters:
seed- The result of the KEXINIT handshake - required for correct session key establishment
-
resolveAvailableSignaturesProposal
protected String resolveAvailableSignaturesProposal(FactoryManager proposedManager) throws IOException, GeneralSecurityException Description copied from class:SessionHelperComputes the list of available host key signature algorithms supported.- Specified by:
resolveAvailableSignaturesProposalin classSessionHelper- Parameters:
proposedManager- TheFactoryManager- Returns:
- A comma-separated list of all the signature protocols to be included in the
proposal -
null/empty if no proposal - Throws:
IOException- If failed to read/parse the keys dataGeneralSecurityException- If failed to generate the keys
-
resolveEmptySignaturesProposal
protected String resolveEmptySignaturesProposal(Iterable<String> supported, Iterable<String> provided) Called byresolveAvailableSignaturesProposal(FactoryManager)if none of the provided keys is supported - last chance for the derived implementation to do something- Parameters:
supported- The supported key types - may benull/emptyprovided- The available signature types - may benull/empty- Returns:
- The resolved proposal -
nullby default
-
readIdentification
Description copied from class:AbstractSessionRead the other side identification. This method is specific to the client or server side, but both should callSessionHelper.doReadIdentification(Buffer, boolean)and store the result in the needed property.- Specified by:
readIdentificationin classAbstractSession- Parameters:
buffer- TheBuffercontaining the remote identification- Returns:
trueif the identification has been fully read orfalseif more data is needed- Throws:
Exception- if an error occurs such as a bad protocol version or unsuccessful KEX was involved
-
receiveKexInit
protected void receiveKexInit(Map<KexProposalOption, String> proposal, byte[] seed) throws IOException- Specified by:
receiveKexInitin classAbstractSession- Throws:
IOException
-
getHostKey
- Specified by:
getHostKeyin interfaceServerSession- Returns:
- The
KeyPairrepresenting the current session's used keys on KEX -nullif not negotiated yet
-
getActiveSessionCountForUser
Description copied from interface:ServerSessionRetrieve the current number of sessions active for a given username.- Specified by:
getActiveSessionCountForUserin interfaceServerSession- Parameters:
userName- The name of the user - ignored ifnull/empty- Returns:
- The current number of live
SshSessionobjects associated with the user
-
getId
public long getId()- Returns:
- The underlying
IoSessionid.
-
getConnectionService
- Specified by:
getConnectionServicein classSessionHelper
-