Top Fields Methods
org.apache.sshd.server.session

public Interface ServerSession

extends Session, ServerProxyAcceptorHolder, ServerAuthenticationManager
Known Direct Implementers
org.apache.sshd.server.session.AbstractServerSession
Imports
java.net.SocketAddress, java.security.KeyPair, org.apache.sshd.common.io.IoWriteFuture, org.apache.sshd.common.session.Session, org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.server.ServerAuthenticationManager, .ServerFactoryManager

Author
Apache MINA SSHD Project

Field Summary

Inherited from org.apache.sshd.server.ServerAuthenticationManager:
DEFAULT_USER_AUTH_GSS_FACTORYDEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORYDEFAULT_USER_AUTH_PASSWORD_FACTORYDEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The current number of live SshSession objects associated with the user
getActiveSessionCountForUser
(String
The name of the user - ignored if null/empty
userName
)

Retrieve the current number of sessions active for a given username.

public SocketAddress

Returns:

The SocketAddress of the remote client. If no proxy wrapping was used then this is the same as the IoSession#getRemoteAddress(). Otherwise, it indicates the real client's address that was somehow transmitted via the proxy meta-data
getClientAddress
()

public ServerFactoryManager
public KeyPair

Returns:

The KeyPair representing the current session's used keys on KEX - null if not negotiated yet
getHostKey
()

public IoWriteFuture

Returns:

An IoWriteFuture that can be used to wait for the SSH_MSG_USERAUTH_SUCCESS message send result
signalAuthenticationSuccess
(String
The authenticated username
username
,
String
The service to start
authService
,
Buffer
Any extra data received to use to start the service
buffer
)

  • Marks the session as authenticated.
  • Starts the specified service.
  • Sends the SSH_MSG_USERAUTH_SUCCESS message.
Inherited from org.apache.sshd.common.session.Session:
createBuffercreateBufferdisconnectexceptionCaughtgetAuthTimeoutgetAuthTimeoutStartgetIdleTimeoutgetIdleTimeoutStartgetIoSessiongetKexgetLocalAddressgetRemoteAddressgetServicegetTimeoutStatusprepareBufferreExchangeKeysrequestrequestrequestrequestresetAuthTimeoutresetIdleTimeoutresolveAttributeresolveAttributesendDebugMessagesendIgnoreMessagesetAuthenticatedstartServicewritePacketwritePacketwritePacketwritePacket
Inherited from org.apache.sshd.server.ServerAuthenticationManager:
getGSSAuthenticatorgetHostBasedAuthenticatorgetHostKeyCertificateProvidergetKeyboardInteractiveAuthenticatorgetPasswordAuthenticatorgetPublickeyAuthenticatorresolveUserAuthFactoriesresolveUserAuthFactoriessetGSSAuthenticatorsetHostBasedAuthenticatorsetHostKeyCertificateProvidersetKeyboardInteractiveAuthenticatorsetPasswordAuthenticatorsetPublickeyAuthenticatorsetUserAuthFactoriesNames
Inherited from org.apache.sshd.server.session.ServerProxyAcceptorHolder:
getServerProxyAcceptorsetServerProxyAcceptor

Method Detail

getActiveSessionCountForUserback to summary
public int getActiveSessionCountForUser(String userName)

Retrieve the current number of sessions active for a given username.

Parameters
userName:String

The name of the user - ignored if null/empty

Returns:int

The current number of live SshSession objects associated with the user

getClientAddressback to summary
public SocketAddress getClientAddress()
Returns:SocketAddress

The SocketAddress of the remote client. If no proxy wrapping was used then this is the same as the IoSession#getRemoteAddress(). Otherwise, it indicates the real client's address that was somehow transmitted via the proxy meta-data

getFactoryManagerback to summary
public ServerFactoryManager getFactoryManager()

Redeclares org.apache.sshd.common.FactoryManagerHolder.getFactoryManager.

Returns:ServerFactoryManager

The ServerFactoryManager for this session

Annotations
@Override
getHostKeyback to summary
public KeyPair getHostKey()
Returns:KeyPair

The KeyPair representing the current session's used keys on KEX - null if not negotiated yet

signalAuthenticationSuccessback to summary
public IoWriteFuture signalAuthenticationSuccess(String username, String authService, Buffer buffer) throws Exception

  • Marks the session as authenticated.
  • Starts the specified service.
  • Sends the SSH_MSG_USERAUTH_SUCCESS message.
Parameters
username:String

The authenticated username

authService:String

The service to start

buffer:Buffer

Any extra data received to use to start the service

Returns:IoWriteFuture

An IoWriteFuture that can be used to wait for the SSH_MSG_USERAUTH_SUCCESS message send result

Exceptions
Exception:
if cannot handle the request