Top Description Fields Constructors Methods
org.apache.sshd.client.session

public abstract Class AbstractClientSession

extends AbstractSession
implements ClientSession
Class Inheritance
All Implemented Interfaces
org.apache.sshd.client.session.ClientSession, org.apache.sshd.common.forward.PortForwardingManager, org.apache.sshd.common.forward.PortForwardingInformationProvider, org.apache.sshd.client.ClientAuthenticationManager, org.apache.sshd.common.keyprovider.KeyIdentityProviderHolder, org.apache.sshd.common.auth.UserAuthFactoriesManager, org.apache.sshd.client.session.ClientProxyConnectorHolder, org.apache.sshd.common.session.Session, org.apache.sshd.common.FactoryManagerHolder, org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager, org.apache.sshd.common.forward.PortForwardingEventListenerManager, org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolverManager, org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolver, org.apache.sshd.common.channel.ChannelListenerManager, org.apache.sshd.common.session.SessionDisconnectHandlerManager, org.apache.sshd.common.session.ReservedSessionMessagesManager, org.apache.sshd.common.session.SessionListenerManager, org.apache.sshd.common.kex.KexFactoryManager, org.apache.sshd.common.kex.extension.KexExtensionHandlerManager, org.apache.sshd.common.signature.SignatureFactoriesManager, org.apache.sshd.common.signature.SignatureFactoriesHolder, org.apache.sshd.common.auth.MutableUserHolder, org.apache.sshd.common.auth.UsernameHolder, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.Closeable, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable, org.apache.sshd.common.AttributeStore, org.apache.sshd.common.AttributeRepository, org.apache.sshd.common.session.SessionHeartbeatController, org.apache.sshd.common.PropertyResolver, org.apache.sshd.common.util.net.ConnectionEndpointsIndicator
Known Direct Subclasses
org.apache.sshd.client.session.ClientSessionImpl
Imports
java.io.IOException, java.net.SocketAddress, java.nio.charset.Charset, .StandardCharsets, java.security.KeyPair, .PublicKey, java.util.Collections, .EnumMap, .List, .Map, .Objects, java.util.concurrent.CopyOnWriteArrayList, org.apache.sshd.client.ClientFactoryManager, org.apache.sshd.client.auth.AuthenticationIdentitiesProvider, .UserAuthFactory, org.apache.sshd.client.auth.hostbased.HostBasedAuthenticationReporter, org.apache.sshd.client.auth.keyboard.UserInteraction, org.apache.sshd.client.auth.password.PasswordAuthenticationReporter, .PasswordIdentityProvider, org.apache.sshd.client.auth.pubkey.PublicKeyAuthenticationReporter, org.apache.sshd.client.channel.ChannelDirectTcpip, .ChannelExec, .ChannelShell, .ChannelSubsystem, .ClientChannel, org.apache.sshd.client.keyverifier.ServerKeyVerifier, org.apache.sshd.common.AttributeRepository, .FactoryManager, .NamedResource, .RuntimeSshException, .Service, .SshConstants, .SshException, org.apache.sshd.common.channel.Channel, .PtyChannelConfigurationHolder, org.apache.sshd.common.cipher.BuiltinCiphers, .CipherNone, org.apache.sshd.common.config.keys.KeyUtils, .OpenSshCertificate, org.apache.sshd.common.forward.Forwarder, org.apache.sshd.common.future.DefaultKeyExchangeFuture, .KeyExchangeFuture, org.apache.sshd.common.io.IoSession, .IoWriteFuture, org.apache.sshd.common.kex.KexProposalOption, .KexState, org.apache.sshd.common.kex.extension.KexExtensionHandler, .KexExtensionHandler.AvailabilityPhase, org.apache.sshd.common.keyprovider.KeyIdentityProvider, org.apache.sshd.common.session.ConnectionService, .SessionContext, .SessionDisconnectHandler, org.apache.sshd.common.session.helpers.AbstractConnectionService, .AbstractSession, org.apache.sshd.common.util.ExceptionUtils, .GenericUtils, .ValidateUtils, org.apache.sshd.common.util.buffer.Buffer, org.apache.sshd.common.util.net.SshdSocketAddress, org.apache.sshd.core.CoreModuleProperties

Provides default implementations of ClientSession related methods
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private SocketAddress
private final AttributeRepository
private HostBasedAuthenticationReporter
private final List<Object>
private final AuthenticationIdentitiesProvider
private KeyIdentityProvider
private PasswordAuthenticationReporter
private PasswordIdentityProvider
private ClientProxyConnector
private PublicKeyAuthenticationReporter
protected final boolean
protected final boolean
private PublicKey
private ServerKeyVerifier
private List<UserAuthFactory>
private UserInteraction
Inherited from org.apache.sshd.common.session.helpers.AbstractSession:
channelListenerProxychannelListenersclientProposalclientVersioncurrentServicedecodeLockdecoderBufferdecoderLengthdecoderStatediscardingencodeLockfirstKexPacketFollowsignorePacketDataLengthignorePacketsCountignorePacketsFrequencyignorePacketsVarianceinBlocksCountinBytesCountinCipherinCipherSizeinCompressioninitialKexDoneinitialKexInitSequenceNumberinMacinMacResultinMacSizeinPacketsCountinSettingskexkexFutureHolderkexHandlerkexInitializedFuturekexStatelastKeyTimeValuemaxRekeyBlocksmaxRekeyBytesmaxRekeyIntervalmaxRekyPacketsnegotiationResultoutBlocksCountoutBytesCountoutCipheroutCipherSizeoutCompressionoutMacoutMacSizeoutPacketsCountoutSettingsrandomrequestLockseqiseqoserverProposalserverVersionSESSIONsessionIdsessionListenerProxysessionListenersstrictKextunnelListenerProxytunnelListenersuncompressBufferunmodClientProposalunmodNegotiationResultunmodServerProposal

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
addPasswordIdentity(String
Password to be added - may not be null/empty

Note

this password is in addition to whatever passwords are available via the PasswordIdentityProvider (if any)

password
)

Implements org.apache.sshd.client.ClientAuthenticationManager.addPasswordIdentity.

public void
addPublicKeyIdentity(KeyPair
The KeyPair to add - may not be null Note: this key is in addition to whatever keys are available via the org.apache.sshd.common.keyprovider.KeyIdentityProvider (if any)
kp
)

Implements org.apache.sshd.client.ClientAuthenticationManager.addPublicKeyIdentity.

protected void
checkKeys()

Implements abstract org.apache.sshd.common.session.helpers.AbstractSession.checkKeys.

Indicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify the server's key

public ClientChannel
createChannel(String
The channel type
type
)

Implements org.apache.sshd.client.session.ClientSession.createChannel.

Create a channel of the given type.

public ClientChannel
createChannel(String
The channel type
type
,
String
The channel sub-type
subType
)

Implements org.apache.sshd.client.session.ClientSession.createChannel.

Create a channel of the given type and sub-type.

public ChannelDirectTcpip
createDirectTcpipChannel(SshdSocketAddress
The local address
local
,
SshdSocketAddress
The remote address
remote
)

Implements org.apache.sshd.client.session.ClientSession.createDirectTcpipChannel.

Create a direct tcp-ip channel which can be used to stream data to a remote port from the server.

public ChannelExec
createExecChannel(String
The command to execute
command
,
Charset
The Charset to use for sending the command string
charset
,
PtyChannelConfigurationHolder
The PTY configuration to use - if null then internal defaults are used
ptyConfig
,
Map<String, ?>
Extra environment configuration to be transmitted to the server - ignored if null/empty.
env
)

Implements org.apache.sshd.client.session.ClientSession.createExecChannel.

Create a channel to execute a command using specific PTY settings and/or environment.

public ChannelExec
createExecChannel(byte[]
The command to execute
command
,
PtyChannelConfigurationHolder
The PTY configuration to use - if null then internal defaults are used
ptyConfig
,
Map<String, ?>
Extra environment configuration to be transmitted to the server - ignored if null/empty.
env
)

Implements org.apache.sshd.client.session.ClientSession.createExecChannel.

Create a channel to execute a command using specific PTY settings and/or environment.

public ChannelShell
createShellChannel(PtyChannelConfigurationHolder
The PTY configuration to use - if null then internal defaults are used
ptyConfig
,
Map<String, ?>
Extra environment configuration to be transmitted to the server - ignored if null/empty.
env
)

Implements org.apache.sshd.client.session.ClientSession.createShellChannel.

Create a channel to start a shell using specific PTY settings and/or environment.

public ChannelSubsystem
createSubsystemChannel(String
The subsystem name
subsystem
)

Implements org.apache.sshd.client.session.ClientSession.createSubsystemChannel.

Create a subsystem channel.

public ClientProxyConnector
public SocketAddress
getConnectAddress()

Implements org.apache.sshd.client.session.ClientSession.getConnectAddress.

Returns the original address (after having been translated through host configuration entries if any) that was request to connect.

public AttributeRepository
protected ConnectionService
public ClientFactoryManager
protected Forwarder
public HostBasedAuthenticationReporter
public KeyIdentityProvider
public PasswordAuthenticationReporter
public PasswordIdentityProvider
public PublicKeyAuthenticationReporter
public AuthenticationIdentitiesProvider
public PublicKey
public ServerKeyVerifier
getServerKeyVerifier()

Implements org.apache.sshd.client.ClientAuthenticationManager.getServerKeyVerifier.

Retrieve the server key verifier to be used to check the key when connecting to an SSH server.

public List<UserAuthFactory>
getUserAuthFactories()

Implements org.apache.sshd.common.auth.UserAuthFactoriesManager.getUserAuthFactories.

Retrieve the list of named factories for UserAuth objects.

protected ClientUserAuthService
public UserInteraction
protected void
protected void
protected boolean
readIdentification(Buffer
The Buffer containing the remote identification
buffer
)

Implements abstract org.apache.sshd.common.session.helpers.AbstractSession.readIdentification.

Read the other side identification.

protected byte[]
protected void
public String
removePasswordIdentity(String
The password to remove - ignored if null/empty
password
)

Implements org.apache.sshd.client.ClientAuthenticationManager.removePasswordIdentity.

public KeyPair
protected String
resolveAvailableSignaturesProposal(FactoryManager manager)

Implements abstract org.apache.sshd.common.session.helpers.SessionHelper.resolveAvailableSignaturesProposal.

Computes the list of available host key signature algorithms supported.

protected IoWriteFuture
protected byte[]
sendKexInit(Map<KexProposalOption, String>
our proposal for key exchange negotiation
proposal
)

Overrides org.apache.sshd.common.session.helpers.AbstractSession.sendKexInit.

Send the key exchange initialization packet.

public void
public void
public void
protected void
setKexSeed(byte...
The result of the KEXINIT handshake - required for correct session key establishment
seed
)

Implements abstract org.apache.sshd.common.session.helpers.AbstractSession.setKexSeed.

public void
public void
public void
public void
public void
public void
public void
public void
protected void
public SshdSocketAddress
startDynamicPortForwarding(SshdSocketAddress
The local address
local
)

Implements org.apache.sshd.common.forward.PortForwardingManager.startDynamicPortForwarding.

Start dynamic local port forwarding using a SOCKS proxy.

public SshdSocketAddress
startLocalPortForwarding(SshdSocketAddress
The local address
local
,
SshdSocketAddress
The remote address
remote
)

Implements org.apache.sshd.common.forward.PortForwardingManager.startLocalPortForwarding.

Start forwarding the given local address on the client to the given address on the server.

public SshdSocketAddress
startRemotePortForwarding(SshdSocketAddress
The remote address
remote
,
SshdSocketAddress
The local address
local
)

Implements org.apache.sshd.common.forward.PortForwardingManager.startRemotePortForwarding.

Start forwarding tcpip from the given address on the server to the given address on the client.

public void
startService(String
Service name
name
,
Buffer
Extra information provided when the service start request was received
buffer
)

Implements org.apache.sshd.common.session.Session.startService.

public void
stopDynamicPortForwarding(SshdSocketAddress
The local address
local
)

Implements org.apache.sshd.common.forward.PortForwardingManager.stopDynamicPortForwarding.

Stop a previously started dynamic port forwarding.

public void
stopLocalPortForwarding(SshdSocketAddress
The local address
local
)

Implements org.apache.sshd.common.forward.PortForwardingManager.stopLocalPortForwarding.

Stop forwarding the given local address.

public void
stopRemotePortForwarding(SshdSocketAddress
The remote address
remote
)

Implements org.apache.sshd.common.forward.PortForwardingManager.stopRemotePortForwarding.

Stop forwarding of the given remote address.

public KeyExchangeFuture
switchToNoneCipher()

Implements org.apache.sshd.client.session.ClientSession.switchToNoneCipher.

Switch to a none cipher for performance.

Inherited from org.apache.sshd.common.session.helpers.AbstractSession:
addChannelListeneraddPortForwardingEventListeneraddSessionListeneraeadOutgoingBufferappendOutgoingMacattachSessioncalculatePadLengthcheckRekeycomparePreferredKexProposalOptioncreateBufferdecodedetermineRekeyBlockLimitdoHandleMessagedoInvokeUnimplementedMessageHandlerdoKexNegotiationdoStrictKexProposaldoWritePacketencodeencryptOutgoingBufferfailStrictKexgetChannelListenerProxygetCipherInformationgetClientKexDatagetClientKexProposalsgetClientVersiongetCompressionInformationgetInnerCloseablegetKexgetKexNegotiationResultgetKexStategetMacInformationgetNegotiatedKexParametergetPortForwardingEventListenerProxygetServerKexDatagetServerKexProposalsgetServerVersiongetServicegetServicesgetSessiongetSessiongetSessionIdgetSessionListenerProxyhandleFirstKexPacketFollowshandleKexExtensionhandleKexInithandleKexMessagehandleMessagehandleNewCompressionhandleNewKeyshandleServiceAccepthandleServiceAccepthandleServiceRequesthandleServiceRequestinitializeCurrentServiceinitializeKeyExchangeMessageHandlerisRekeyBlocksCountExceededisRekeyDataSizeExceededisRekeyPacketCountsExceededisRekeyRequiredisRekeyTimeIntervalExceededmessageReceivednegotiatenotImplementedperformKexNegotiationpreCloseprepareBufferprepareNewKeyspreProcessEncodeBufferreceiveKexInitreExchangeKeysrefreshConfigurationremoveChannelListenerremovePortForwardingEventListenerremoveSessionListenerremoveValuerequestrequestrequestFailurerequestNewKeysExchangerequestSuccessresolveIgnoreBufferDataLengthresolveOutputPacketresolveSessionKexProposalsendKexInitsendNewKeyssetClientKexDatasetInputEncodingsetNegotiationResultsetOutputEncodingsetServerKexDatavalidateIncomingMacvalidateKexStatevalidateServiceKexStatevalidateTargetBufferwritePacketwritePacket