Implements the “publickey” SSH authentication method.
Public instance methods
authenticate
(next_service, username, password=nil)
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. This requires the presence of a key manager.
[show source]
# File lib/net/ssh/authentication/methods/publickey.rb, line 16 16: def authenticate(next_service, username, password=nil) 17: return false unless key_manager 18: 19: key_manager.each_identity do |identity| 20: return true if authenticate_with(identity, next_service, username) 21: end 22: 23: return false 24: end