diff options
Diffstat (limited to 'lib/net/ssh/authentication')
-rw-r--r-- | lib/net/ssh/authentication/agent/socket.rb | 2 | ||||
-rw-r--r-- | lib/net/ssh/authentication/key_manager.rb | 11 | ||||
-rw-r--r-- | lib/net/ssh/authentication/session.rb | 4 |
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/net/ssh/authentication/agent/socket.rb b/lib/net/ssh/authentication/agent/socket.rb index 0bb43a1..c80099e 100644 --- a/lib/net/ssh/authentication/agent/socket.rb +++ b/lib/net/ssh/authentication/agent/socket.rb @@ -77,6 +77,8 @@ module Net; module SSH; module Authentication if type == SSH2_AGENT_VERSION_RESPONSE raise AgentNotAvailable, "SSH2 agents are not yet supported" + elsif type == SSH2_AGENT_FAILURE + debug { "Unexpected response type==#{type}, this will be ignored" } elsif type != SSH_AGENT_RSA_IDENTITIES_ANSWER1 && type != SSH_AGENT_RSA_IDENTITIES_ANSWER2 raise AgentNotAvailable, "unknown response from agent: #{type}, #{body.to_s.inspect}" end diff --git a/lib/net/ssh/authentication/key_manager.rb b/lib/net/ssh/authentication/key_manager.rb index dc9480b..9847750 100644 --- a/lib/net/ssh/authentication/key_manager.rb +++ b/lib/net/ssh/authentication/key_manager.rb @@ -37,13 +37,13 @@ module Net attr_reader :options # Create a new KeyManager. By default, the manager will - # use the ssh-agent if it is running and the `:keys_only` option - # is not true. + # use the ssh-agent if it is running and the `:use_agent` option + # is not false. def initialize(logger, options={}) self.logger = logger @key_files = [] @key_data = [] - @use_agent = !options[:keys_only] + @use_agent = !(options[:use_agent] == false) @known_identities = {} @agent = nil @options = options @@ -92,8 +92,9 @@ module Net # ssh-agent. Note that identities from an ssh-agent are always listed # first in the array, with other identities coming after. # - # If key manager was created with :keys_only option, no identities - # from ssh-agent will be loaded. + # If key manager was created with :keys_only option, any identity + # from ssh-agent will be ignored unless it present in key_files or + # key_data. def each_identity prepared_identities = prepare_identities_from_files + prepare_identities_from_data diff --git a/lib/net/ssh/authentication/session.rb b/lib/net/ssh/authentication/session.rb index c63bf41..5ac2cdc 100644 --- a/lib/net/ssh/authentication/session.rb +++ b/lib/net/ssh/authentication/session.rb @@ -133,8 +133,8 @@ module Net; module SSH; module Authentication # by system default. def default_keys if defined?(OpenSSL::PKey::EC) - %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh/id_ecdsa - ~/.ssh2/id_dsa ~/.ssh2/id_rsa ~/.ssh2/id_ecdsa) + %w(~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_dsa ~/.ssh/id_ecdsa + ~/.ssh2/id_ed25519 ~/.ssh2/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_ecdsa) else %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_rsa) end |