Class Net::SSH::UserAuth::Methods::PublicKey
In: lib/net/ssh/userauth/methods/publickey.rb
Parent: Object

Implements the "publickey" SSH authentication method.

Methods

authenticate   new  

Included Modules

Net::SSH::UserAuth::Constants

Attributes

messenger  [W]  The messenger instance to use to send and receive messages
session_id  [W]  The session id of the current SSH session

Public Class methods

Create a new PublicKey instance that uses the given buffer factory to produce new buffer instances.

[Source]

    # File lib/net/ssh/userauth/methods/publickey.rb, line 37
37:           def initialize( buffers )
38:             @buffers = buffers
39:           end

Public Instance methods

Attempts to perform public-key authentication for the given username, trying each identity known to the key manager. If any of them succeed, returns true, otherwise returns false. The data hash must contain a UserKeyManager instance under the :key_manager key.

[Source]

    # File lib/net/ssh/userauth/methods/publickey.rb, line 46
46:           def authenticate( next_service, username, data={} )
47:             key_manager = data[:key_manager]
48:             return false unless key_manager
49: 
50:             key_manager.identities.each do |identity|
51:               return true if authenticate_with( identity, next_service,
52:                 username, key_manager )
53:             end
54: 
55:             return false
56: 
57:           ensure
58:             key_manager.finish if key_manager
59:           end

[Validate]