Class | Net::SSH::Authentication::Methods::Publickey |
In: |
lib/net/ssh/authentication/methods/publickey.rb
lib/net/ssh/authentication/methods/publickey.rb |
Parent: | Abstract |
Implements the "publickey" SSH authentication method.
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.
# 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.identities.each do |identity| 20: return true if authenticate_with(identity, next_service, username) 21: end 22: 23: return false 24: end
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.
# 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.identities.each do |identity| 20: return true if authenticate_with(identity, next_service, username) 21: end 22: 23: return false 24: end