public
Description: Pure Ruby implementation of an SSH (protocol 2) client
Homepage: http://rubyforge.org/projects/net-ssh
Clone URL: git://github.com/jamis/net-ssh.git
teach the key manager about a handful of default key names
Jamis Buck (author)
Fri May 02 20:02:52 -0700 2008
commit  ba7066885639c4e3ded3df4e05aae6fa2a9d1d6f
tree    328aafb01d62158a0dcd59ea281aec153d5c537a
parent  dd1574a04e7c1088a06dae2d1676f4f5ff1aeaef
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+=== *unreleased*
0
+
0
+* Teach Net::SSH about a handful of default key names [Jamis Buck]
0
+
0
+
0
 === 2.0.0 / 1 May 2008
0
 
0
 * Allow the :verbose argument to accept symbols (:debug, etc.) as well as Logger level constants (Logger::DEBUG, etc.) [Jamis Buck]
...
53
54
55
56
 
57
58
59
...
112
113
114
 
 
 
 
 
 
 
 
 
 
 
115
116
117
...
53
54
55
 
56
57
58
59
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
0
@@ -53,7 +53,7 @@ module Net; module SSH; module Authentication
0
       message = expect_message(SERVICE_ACCEPT)
0
 
0
       key_manager = KeyManager.new(logger, options)
0
-      Array(options[:keys]).each { |key| key_manager.add(key) }
0
+      keys.each { |key| key_manager.add(key) }
0
 
0
       attempted = []
0
 
0
@@ -112,5 +112,16 @@ module Net; module SSH; module Authentication
0
       end
0
       message
0
     end
0
+
0
+    private
0
+
0
+      # Returns an array of paths to the key files that should be used when
0
+      # attempting any key-based authentication mechanism.
0
+      def keys
0
+        Array(
0
+          options[:keys] ||
0
+          %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_rsa)
0
+        )
0
+      end
0
   end
0
 end; end; end
0
\ No newline at end of file

Comments