Class: Net::SSH::Authentication::Session

Class | Net::SSH::Authentication::Session
In: | lib/net/ssh/authentication/session.rb
Parent: | Object

Represents an authentication session. It manages the authentication of a user over an established connection (the "transport" object, see Net::SSH::Transport::Session).

The use of an authentication session to manage user authentication is internal to Net::SSH (specifically Net::SSH.start). Consumers of the Net::SSH library will never need to access this class directly.

### Methods

authenticate expect_message new next_message

### Included Modules

Transport::Constants Constants Loggable

### Attributes

allowed_auth_methods | [R] | the list of authentication methods that are allowed
auth_methods | [R] | the list of authentication methods to try
options | [R] | a hash of options, given at construction time
transport | [R] | transport layer abstraction

### Public Class methods

new(transport, options={})

Instantiates a new Authentication::Session object over the given transport layer abstraction.

### Public Instance methods

authenticate(next_service, username, password=nil)

Attempts to authenticate the given user, in preparation for the next service request. Returns true if an authentication method succeeds in authenticating the user, and false otherwise.

expect_message(type)

Blocks until a packet is received, and returns it if it is of the given type. If it is not, an exception is raised.

next_message()

Blocks until a packet is received. It silently handles USERAUTH_BANNER packets, and will raise an error if any packet is received that is not valid during user authentication.

[Validate]