Method: Net::SSH::Authentication::Methods::Hostbased#authenticate

Defined in:
lib/net/ssh/authentication/methods/hostbased.rb

#authenticate(next_service, username, password = nil) ⇒ Object

Attempts to perform host-based authorization of the user by trying all known keys.



13
14
15
16
17
18
19
20
21
22
# File 'lib/net/ssh/authentication/methods/hostbased.rb', line 13

def authenticate(next_service, username, password = nil)
  return false unless key_manager

  key_manager.each_identity do |identity|
    return true if authenticate_with(identity, next_service,
                                     username, key_manager)
  end

  return false
end