minmb-net-ssh 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +291 -0
- data/Manifest +132 -0
- data/README.rdoc +184 -0
- data/Rakefile +86 -0
- data/Rudyfile +96 -0
- data/THANKS.rdoc +19 -0
- data/lib/net/ssh.rb +223 -0
- data/lib/net/ssh/authentication/agent.rb +23 -0
- data/lib/net/ssh/authentication/agent/java_pageant.rb +85 -0
- data/lib/net/ssh/authentication/agent/socket.rb +170 -0
- data/lib/net/ssh/authentication/constants.rb +18 -0
- data/lib/net/ssh/authentication/key_manager.rb +253 -0
- data/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/lib/net/ssh/authentication/methods/hostbased.rb +75 -0
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +70 -0
- data/lib/net/ssh/authentication/methods/password.rb +43 -0
- data/lib/net/ssh/authentication/methods/publickey.rb +96 -0
- data/lib/net/ssh/authentication/pageant.rb +301 -0
- data/lib/net/ssh/authentication/session.rb +154 -0
- data/lib/net/ssh/buffer.rb +350 -0
- data/lib/net/ssh/buffered_io.rb +207 -0
- data/lib/net/ssh/config.rb +207 -0
- data/lib/net/ssh/connection/channel.rb +630 -0
- data/lib/net/ssh/connection/constants.rb +33 -0
- data/lib/net/ssh/connection/session.rb +603 -0
- data/lib/net/ssh/connection/term.rb +178 -0
- data/lib/net/ssh/errors.rb +88 -0
- data/lib/net/ssh/key_factory.rb +107 -0
- data/lib/net/ssh/known_hosts.rb +141 -0
- data/lib/net/ssh/loggable.rb +61 -0
- data/lib/net/ssh/packet.rb +102 -0
- data/lib/net/ssh/prompt.rb +93 -0
- data/lib/net/ssh/proxy/command.rb +75 -0
- data/lib/net/ssh/proxy/errors.rb +14 -0
- data/lib/net/ssh/proxy/http.rb +94 -0
- data/lib/net/ssh/proxy/socks4.rb +70 -0
- data/lib/net/ssh/proxy/socks5.rb +142 -0
- data/lib/net/ssh/ruby_compat.rb +77 -0
- data/lib/net/ssh/service/forward.rb +327 -0
- data/lib/net/ssh/test.rb +89 -0
- data/lib/net/ssh/test/channel.rb +129 -0
- data/lib/net/ssh/test/extensions.rb +152 -0
- data/lib/net/ssh/test/kex.rb +44 -0
- data/lib/net/ssh/test/local_packet.rb +51 -0
- data/lib/net/ssh/test/packet.rb +81 -0
- data/lib/net/ssh/test/remote_packet.rb +38 -0
- data/lib/net/ssh/test/script.rb +157 -0
- data/lib/net/ssh/test/socket.rb +64 -0
- data/lib/net/ssh/transport/algorithms.rb +407 -0
- data/lib/net/ssh/transport/cipher_factory.rb +106 -0
- data/lib/net/ssh/transport/constants.rb +32 -0
- data/lib/net/ssh/transport/ctr.rb +95 -0
- data/lib/net/ssh/transport/hmac.rb +45 -0
- data/lib/net/ssh/transport/hmac/abstract.rb +79 -0
- data/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/lib/net/ssh/transport/hmac/ripemd160.rb +13 -0
- data/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/lib/net/ssh/transport/hmac/sha2_256.rb +15 -0
- data/lib/net/ssh/transport/hmac/sha2_256_96.rb +13 -0
- data/lib/net/ssh/transport/hmac/sha2_512.rb +14 -0
- data/lib/net/ssh/transport/hmac/sha2_512_96.rb +13 -0
- data/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/lib/net/ssh/transport/kex.rb +28 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +44 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +216 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +80 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +15 -0
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +93 -0
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +13 -0
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +13 -0
- data/lib/net/ssh/transport/key_expander.rb +26 -0
- data/lib/net/ssh/transport/openssl.rb +237 -0
- data/lib/net/ssh/transport/packet_stream.rb +235 -0
- data/lib/net/ssh/transport/server_version.rb +71 -0
- data/lib/net/ssh/transport/session.rb +278 -0
- data/lib/net/ssh/transport/state.rb +206 -0
- data/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/lib/net/ssh/verifiers/null.rb +12 -0
- data/lib/net/ssh/verifiers/strict.rb +53 -0
- data/lib/net/ssh/version.rb +62 -0
- data/net-ssh.gemspec +164 -0
- data/setup.rb +1585 -0
- data/support/arcfour_check.rb +20 -0
- data/support/ssh_tunnel_bug.rb +65 -0
- data/test/authentication/methods/common.rb +28 -0
- data/test/authentication/methods/test_abstract.rb +51 -0
- data/test/authentication/methods/test_hostbased.rb +114 -0
- data/test/authentication/methods/test_keyboard_interactive.rb +100 -0
- data/test/authentication/methods/test_password.rb +52 -0
- data/test/authentication/methods/test_publickey.rb +148 -0
- data/test/authentication/test_agent.rb +205 -0
- data/test/authentication/test_key_manager.rb +218 -0
- data/test/authentication/test_session.rb +106 -0
- data/test/common.rb +107 -0
- data/test/configs/eqsign +3 -0
- data/test/configs/exact_match +8 -0
- data/test/configs/host_plus +10 -0
- data/test/configs/multihost +4 -0
- data/test/configs/wild_cards +14 -0
- data/test/connection/test_channel.rb +467 -0
- data/test/connection/test_session.rb +488 -0
- data/test/known_hosts/github +1 -0
- data/test/test_all.rb +9 -0
- data/test/test_buffer.rb +426 -0
- data/test/test_buffered_io.rb +63 -0
- data/test/test_config.rb +120 -0
- data/test/test_key_factory.rb +121 -0
- data/test/test_known_hosts.rb +13 -0
- data/test/transport/hmac/test_md5.rb +39 -0
- data/test/transport/hmac/test_md5_96.rb +25 -0
- data/test/transport/hmac/test_none.rb +34 -0
- data/test/transport/hmac/test_ripemd160.rb +34 -0
- data/test/transport/hmac/test_sha1.rb +34 -0
- data/test/transport/hmac/test_sha1_96.rb +25 -0
- data/test/transport/hmac/test_sha2_256.rb +35 -0
- data/test/transport/hmac/test_sha2_256_96.rb +25 -0
- data/test/transport/hmac/test_sha2_512.rb +35 -0
- data/test/transport/hmac/test_sha2_512_96.rb +25 -0
- data/test/transport/kex/test_diffie_hellman_group14_sha1.rb +13 -0
- data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +33 -0
- data/test/transport/kex/test_ecdh_sha2_nistp256.rb +161 -0
- data/test/transport/kex/test_ecdh_sha2_nistp384.rb +37 -0
- data/test/transport/kex/test_ecdh_sha2_nistp521.rb +37 -0
- data/test/transport/test_algorithms.rb +330 -0
- data/test/transport/test_cipher_factory.rb +441 -0
- data/test/transport/test_hmac.rb +34 -0
- data/test/transport/test_identity_cipher.rb +40 -0
- data/test/transport/test_packet_stream.rb +1745 -0
- data/test/transport/test_server_version.rb +78 -0
- data/test/transport/test_session.rb +315 -0
- data/test/transport/test_state.rb +179 -0
- metadata +208 -0
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,291 @@
|
|
1
|
+
|
2
|
+
=== 2.5.1 / 24 May 2012
|
3
|
+
|
4
|
+
* Added missing file to manifest [Marco Sandrini]
|
5
|
+
|
6
|
+
=== 2.5.0 / 24 May 2012
|
7
|
+
|
8
|
+
* Implement many algorithms [Ryosuke Yamazaki]
|
9
|
+
* Key Exchange
|
10
|
+
* diffie-hellman-group14-sha1
|
11
|
+
* ecdh-sha2-nistp{256,384,521}
|
12
|
+
* Host Key
|
13
|
+
* ecdsa-sha2-nistp{256,384,521}
|
14
|
+
* Authentication
|
15
|
+
* ecdsa-sha2-nistp{256,384,521}
|
16
|
+
* HMAC
|
17
|
+
* hmac-ripemd160
|
18
|
+
* Cipher:
|
19
|
+
* aes{128,192,256}-ctr
|
20
|
+
* camellia{128,192,256}-ctr
|
21
|
+
* blowfish-ctr
|
22
|
+
* cast128-ctr
|
23
|
+
* 3des-ctr
|
24
|
+
* arcfour (has problems with weak keys, and should be used with caution)
|
25
|
+
* camellia{128,192,256}-cbc
|
26
|
+
|
27
|
+
=== 2.4.0 / 17 May 2012
|
28
|
+
|
29
|
+
* Support for JRuby + Pageant + Windows [arturaz]
|
30
|
+
|
31
|
+
=== 2.3.0 / 11 Jan 2012
|
32
|
+
|
33
|
+
* Support for hmac-sha2 and diffie-hellman-group-exchange-sha256 [Ryosuke Yamazaki]
|
34
|
+
|
35
|
+
=== 2.2.2 / 04 Jan 2012
|
36
|
+
|
37
|
+
* Fixed: Connection hangs on ServerVersion.new(socket, logger) [muffl0n]
|
38
|
+
* Avoid dying when unsupported auth mechanisms are defined [pcn]
|
39
|
+
|
40
|
+
=== 2.2.1 / 24 Aug 2011
|
41
|
+
|
42
|
+
* Do not prompt any passphrases before trying all identities from agent. [musybite]
|
43
|
+
(see: http://net-ssh.lighthouseapp.com/projects/36253-net-ssh/tickets/30)
|
44
|
+
|
45
|
+
=== 2.2.0 / 16 Aug 2011
|
46
|
+
|
47
|
+
* Add support for forward a local UNIX domain socket to a remote TCP socket. [Mark Imbriaco]
|
48
|
+
|
49
|
+
=== 2.1.4 / 3 Apr 2011
|
50
|
+
|
51
|
+
* Add ConnectionTimeout exception class. [Joel Watson]
|
52
|
+
See: https://github.com/net-ssh/net-ssh-multi/pull/1
|
53
|
+
|
54
|
+
|
55
|
+
=== 2.1.3 / 2 Mar 2011
|
56
|
+
|
57
|
+
* Call to transport.closed should be transport.close [Woon Jung]
|
58
|
+
|
59
|
+
|
60
|
+
=== 2.1.2 / 1 Mar 2011
|
61
|
+
|
62
|
+
* Fix for Net::SSH Continues to attempt authentication when notified it is not allowed [Eric Hodel]
|
63
|
+
(see: http://net-ssh.lighthouseapp.com/projects/36253-net-ssh/tickets/26)
|
64
|
+
* Fix for transport won't be closed if authentication fails [Patrick Marchi]
|
65
|
+
|
66
|
+
|
67
|
+
=== 2.1 / 19 Jan 2011
|
68
|
+
|
69
|
+
* Support "IdentitiesOnly" directive (LH-24) [Musy Bite, Edmund Haselwanter]
|
70
|
+
* Speeding up the Loggable module (LH-23) [robbebob]
|
71
|
+
|
72
|
+
|
73
|
+
=== 2.0.24 / 14 Jan 2011
|
74
|
+
|
75
|
+
* Fix for process code to correctly wait until remote_id is set before sending any output, including eof. [Daniel Pittman, Markus Roberts]
|
76
|
+
* Fix circular require warning in Ruby 1.9.2 [Gavin Brock]
|
77
|
+
|
78
|
+
|
79
|
+
=== 2.0.23 / 03 Jun 2010
|
80
|
+
|
81
|
+
* delay CHANNEL_EOF packet until output buffer is empty [Rich Lane]
|
82
|
+
|
83
|
+
Previously, calling #eof! after #send_data would result in the CHANNEL_EOF
|
84
|
+
packet being sent immediately, ahead of the data in the output buffer. Now
|
85
|
+
buffer becomes empty.
|
86
|
+
|
87
|
+
|
88
|
+
=== 2.0.22 / 20 Apr 2010
|
89
|
+
|
90
|
+
* Fix for: "Parsing the config errors out because it coerces the "1" into an integer and then tries to split it on spaces for multiple host checking." (http://net-ssh.lighthouseapp.com/projects/36253/tickets/10) [Lee Marlow]
|
91
|
+
|
92
|
+
|
93
|
+
=== 2.0.21 / 20 Mar 2010
|
94
|
+
|
95
|
+
* Fix for "IdentifyFile" in ~/.ssh/config does not work if no "Host" statement is given (http://net-ssh.lighthouseapp.com/projects/36253/tickets/9-identifyfile-in-sshconfig-does-not-work-if-no-host-statement-is-given#ticket-9-5) [xbaldauf, Delano Mandelbaum]
|
96
|
+
|
97
|
+
* Fix for client closes a forwarded connection, but the server is reading, net-ssh terminates with IOError socket closed (http://net-ssh.lighthouseapp.com/projects/36253/tickets/7) [Miklós Fazekas]
|
98
|
+
|
99
|
+
* Fix for client force closes (RST) a forwarded connection, but server is reading, net-ssh terminates with exception [Miklós Fazekas]
|
100
|
+
|
101
|
+
* Fix for server closes the sending side, the on_eof is not handled. [Miklós Fazekas]
|
102
|
+
|
103
|
+
* Removed Hanna dependency in Rakefile [Delano Mandelbaum]
|
104
|
+
|
105
|
+
|
106
|
+
=== 2.0.20 / 10 Feb 2010
|
107
|
+
|
108
|
+
* Support "ProxyCommand none" directive [Andy Lo-A-Foe]
|
109
|
+
|
110
|
+
=== 2.0.19 / 16 Jan 2010
|
111
|
+
|
112
|
+
* Support plus sign in sshconfig hostname [Jason Weathered]
|
113
|
+
|
114
|
+
=== 2.0.18 / 15 Jan 2010
|
115
|
+
|
116
|
+
* Fix related to #recv(1) to #readpartial change in 2.0.16 [Hans de Graaff, Delano Mandelbaum]
|
117
|
+
|
118
|
+
|
119
|
+
=== 2.0.17 / 14 Dec 2009
|
120
|
+
|
121
|
+
* Don't load net/ssh/authentication/pageant on Windows with Ruby 1.9 [Travis Reeder, Delano Mandelbaum]
|
122
|
+
|
123
|
+
|
124
|
+
=== 2.0.16 / 28 Nov 2009
|
125
|
+
|
126
|
+
* Fix for "multiple hosts are separated by whitespace" [Akinori MUSHA]
|
127
|
+
|
128
|
+
* Add support for the ProxyCommand directive [Akinori MUSHA]
|
129
|
+
|
130
|
+
* Switched from #recv(1) to #readpartial in lib/net/ssh/transport/server_version.rb, so that closed sockets are recognized [Alex Peuchert]
|
131
|
+
|
132
|
+
|
133
|
+
=== 2.0.15 / 03 Sep 2009
|
134
|
+
|
135
|
+
* Scale back IO#select patch so it mutexes only zero-timeout calls [Daniel Azuma, Will Bryant]
|
136
|
+
|
137
|
+
|
138
|
+
=== 2.0.14 / 28 Aug 2009
|
139
|
+
|
140
|
+
* Fix for IO#select threading bug in Ruby 1.8 (LH-1) [Daniel Azuma]
|
141
|
+
|
142
|
+
* Fix for "uninitialized constant OpenSSL::Digest::MD5" exception in Net::SFTP [DL Redden]
|
143
|
+
|
144
|
+
|
145
|
+
=== 2.0.13 / 17 Aug 2009
|
146
|
+
|
147
|
+
* Added fix for hanging in ServerVersion#negotiate! when using SOCKS5 proxy (GH-9) [Gerald Talton]
|
148
|
+
|
149
|
+
* Added support for specifying a list of hosts in .ssh/config, with tests (GH-6) [ckoehler, Delano Mandelbaum]
|
150
|
+
|
151
|
+
* Added tests for arcfour128/256/512 lengths, encryption, and decryption [Delano Mandelbaum]
|
152
|
+
|
153
|
+
* Skip packet stream tests for arcfour128/256/512 [Delano Mandelbaum]
|
154
|
+
|
155
|
+
* Fix for OpenSSL cipher key length because it always returns 16, even when 32 byte keys are required, e.g. for arcfour256 and arcfour512 ciphers [Karl Varga]
|
156
|
+
|
157
|
+
|
158
|
+
=== 2.0.12 / 08 Jun 2009
|
159
|
+
|
160
|
+
* Applied patch for arcfour128 and arcfour256 support [Denis Bernard]
|
161
|
+
|
162
|
+
* Use unbuffered reads when negotiating the protocol version [Steven Hazel]
|
163
|
+
|
164
|
+
|
165
|
+
=== 2.0.11 / 24 Feb 2009
|
166
|
+
|
167
|
+
* Add :key_data option for specifying raw private keys in PEM format [Alex Holems, Andrew Babkin]
|
168
|
+
|
169
|
+
|
170
|
+
=== 2.0.10 / 4 Feb 2009
|
171
|
+
|
172
|
+
* Added Net::SSH.configuration_for to make it easier to query the SSH configuration file(s) [Jamis Buck]
|
173
|
+
|
174
|
+
|
175
|
+
=== 2.0.9 / 1 Feb 2009
|
176
|
+
|
177
|
+
* Specifying non-nil user argument overrides user in .ssh/config [Jamis Buck]
|
178
|
+
|
179
|
+
* Ignore requests for non-existent channels (workaround ssh server bug) [Jamis Buck]
|
180
|
+
|
181
|
+
* Add terminate! method for hard shutdown scenarios [Jamis Buck]
|
182
|
+
|
183
|
+
* Revert to pre-2.0.7 key-loading behavior by default, but load private-key if public-key doesn't exist [Jamis Buck]
|
184
|
+
|
185
|
+
* Make sure :passphrase option gets passed to key manager [Bob Cotton]
|
186
|
+
|
187
|
+
|
188
|
+
=== 2.0.8 / 29 December 2008
|
189
|
+
|
190
|
+
* Fix private key change from 2.0.7 so that keys are loaded just-in-time, avoiding unecessary prompts from encrypted keys. [Jamis Buck]
|
191
|
+
|
192
|
+
|
193
|
+
=== 2.0.7 / 29 December 2008
|
194
|
+
|
195
|
+
* Make key manager use private keys instead of requiring public key to exist [arilerner@mac.com]
|
196
|
+
|
197
|
+
* Fix failing tests [arilerner@mac.com]
|
198
|
+
|
199
|
+
* Don't include pageant when running under JRuby [Angel N. Sciortino]
|
200
|
+
|
201
|
+
|
202
|
+
=== 2.0.6 / 6 December 2008
|
203
|
+
|
204
|
+
* Update the Manifest file so that the gem includes all necessary files [Jamis Buck]
|
205
|
+
|
206
|
+
|
207
|
+
=== 2.0.5 / 6 December 2008
|
208
|
+
|
209
|
+
* Make the Pageant interface comply with more of the Socket interface to avoid related errors [Jamis Buck]
|
210
|
+
|
211
|
+
* Don't busy-wait on session close for remaining channels to close [Will Bryant]
|
212
|
+
|
213
|
+
* Ruby 1.9 compatibility [Jamis Buck]
|
214
|
+
|
215
|
+
* Fix Cipher#final to correctly flag a need for a cipher reset [Jamis Buck]
|
216
|
+
|
217
|
+
|
218
|
+
=== 2.0.4 / 27 Aug 2008
|
219
|
+
|
220
|
+
* Added Connection::Session#closed? and Transport::Session#closed? [Jamis Buck]
|
221
|
+
|
222
|
+
* Numeric host names in .ssh/config are now parsed correct [Yanko Ivanov]
|
223
|
+
|
224
|
+
* Make sure the error raised when a public key file is malformed is more informative than a MethodMissing error [Jamis Buck]
|
225
|
+
|
226
|
+
* Cipher#reset is now called after Cipher#final, with the last n bytes used as the next initialization vector [Jamis Buck]
|
227
|
+
|
228
|
+
|
229
|
+
=== 2.0.3 / 27 Jun 2008
|
230
|
+
|
231
|
+
* Make Net::SSH::Version comparable [Brian Candler]
|
232
|
+
|
233
|
+
* Fix errors in port forwarding when a channel could not be opened due to a typo in the exception name [Matthew Todd]
|
234
|
+
|
235
|
+
* Use #chomp instead of #strip when cleaning the version string reported by the remote host, so that trailing whitespace is preserved (this is to play nice with servers like Mocana SSH) [Timo Gatsonides]
|
236
|
+
|
237
|
+
* Correctly parse ssh_config entries with eq-sign delimiters [Jamis Buck]
|
238
|
+
|
239
|
+
* Ignore malformed ssh_config entries [Jamis Buck]
|
240
|
+
|
241
|
+
=== 2.0.2 / 29 May 2008
|
242
|
+
|
243
|
+
* Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
|
244
|
+
|
245
|
+
* Fixed key truncation bug that caused hmacs other than SHA1 to fail with "corrupt hmac" errors [Jamis Buck]
|
246
|
+
|
247
|
+
* Fix detection and loading of public keys when the keys don't actually exist [David Dollar]
|
248
|
+
|
249
|
+
|
250
|
+
=== 2.0.1 / 5 May 2008
|
251
|
+
|
252
|
+
* Teach Net::SSH about a handful of default key names [Jamis Buck]
|
253
|
+
|
254
|
+
|
255
|
+
=== 2.0.0 / 1 May 2008
|
256
|
+
|
257
|
+
* Allow the :verbose argument to accept symbols (:debug, etc.) as well as Logger level constants (Logger::DEBUG, etc.) [Jamis Buck]
|
258
|
+
|
259
|
+
|
260
|
+
=== 2.0 Preview Release 4 (1.99.3) / 19 Apr 2008
|
261
|
+
|
262
|
+
* Make sure HOME is set to something sane, even on OS's that don't set it by default [Jamis Buck]
|
263
|
+
|
264
|
+
* Add a :passphrase option to specify the passphrase to use with private keys [Francis Sullivan]
|
265
|
+
|
266
|
+
* Open a new auth agent connection for every auth-agent channel request [Jamis Buck]
|
267
|
+
|
268
|
+
|
269
|
+
=== 2.0 Preview Release 3 (1.99.2) / 10 Apr 2008
|
270
|
+
|
271
|
+
* Session properties [Jamis Buck]
|
272
|
+
|
273
|
+
* Make channel open failure work with a callback so that failures can be handled similarly to successes [Jamis Buck]
|
274
|
+
|
275
|
+
|
276
|
+
=== 2.0 Preview Release 2 (1.99.1) / 22 Mar 2008
|
277
|
+
|
278
|
+
* Partial support for ~/.ssh/config (and related) SSH configuration files [Daniel J. Berger, Jamis Buck]
|
279
|
+
|
280
|
+
* Added Net::SSH::Test to facilitate testing complex SSH state machines [Jamis Buck]
|
281
|
+
|
282
|
+
* Reworked Net::SSH::Prompt to use conditionally-selected modules [Jamis Buck, suggested by James Rosen]
|
283
|
+
|
284
|
+
* Added Channel#eof? and Channel#eof! [Jamis Buck]
|
285
|
+
|
286
|
+
* Fixed bug in strict host key verifier on cache miss [Mike Timm]
|
287
|
+
|
288
|
+
|
289
|
+
=== 2.0 Preview Release 1 (1.99.0) / 21 Aug 2007
|
290
|
+
|
291
|
+
* First preview release of Net::SSH v2
|
data/Manifest
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
CHANGELOG.rdoc
|
2
|
+
Manifest
|
3
|
+
README.rdoc
|
4
|
+
Rakefile
|
5
|
+
Rudyfile
|
6
|
+
THANKS.rdoc
|
7
|
+
lib/net/ssh.rb
|
8
|
+
lib/net/ssh/authentication/agent.rb
|
9
|
+
lib/net/ssh/authentication/constants.rb
|
10
|
+
lib/net/ssh/authentication/key_manager.rb
|
11
|
+
lib/net/ssh/authentication/methods/abstract.rb
|
12
|
+
lib/net/ssh/authentication/methods/hostbased.rb
|
13
|
+
lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
14
|
+
lib/net/ssh/authentication/methods/password.rb
|
15
|
+
lib/net/ssh/authentication/methods/publickey.rb
|
16
|
+
lib/net/ssh/authentication/pageant.rb
|
17
|
+
lib/net/ssh/authentication/session.rb
|
18
|
+
lib/net/ssh/buffer.rb
|
19
|
+
lib/net/ssh/buffered_io.rb
|
20
|
+
lib/net/ssh/config.rb
|
21
|
+
lib/net/ssh/connection/channel.rb
|
22
|
+
lib/net/ssh/connection/constants.rb
|
23
|
+
lib/net/ssh/connection/session.rb
|
24
|
+
lib/net/ssh/connection/term.rb
|
25
|
+
lib/net/ssh/errors.rb
|
26
|
+
lib/net/ssh/key_factory.rb
|
27
|
+
lib/net/ssh/known_hosts.rb
|
28
|
+
lib/net/ssh/loggable.rb
|
29
|
+
lib/net/ssh/packet.rb
|
30
|
+
lib/net/ssh/prompt.rb
|
31
|
+
lib/net/ssh/proxy/command.rb
|
32
|
+
lib/net/ssh/proxy/errors.rb
|
33
|
+
lib/net/ssh/proxy/http.rb
|
34
|
+
lib/net/ssh/proxy/socks4.rb
|
35
|
+
lib/net/ssh/proxy/socks5.rb
|
36
|
+
lib/net/ssh/ruby_compat.rb
|
37
|
+
lib/net/ssh/service/forward.rb
|
38
|
+
lib/net/ssh/test.rb
|
39
|
+
lib/net/ssh/test/channel.rb
|
40
|
+
lib/net/ssh/test/extensions.rb
|
41
|
+
lib/net/ssh/test/kex.rb
|
42
|
+
lib/net/ssh/test/local_packet.rb
|
43
|
+
lib/net/ssh/test/packet.rb
|
44
|
+
lib/net/ssh/test/remote_packet.rb
|
45
|
+
lib/net/ssh/test/script.rb
|
46
|
+
lib/net/ssh/test/socket.rb
|
47
|
+
lib/net/ssh/transport/algorithms.rb
|
48
|
+
lib/net/ssh/transport/cipher_factory.rb
|
49
|
+
lib/net/ssh/transport/constants.rb
|
50
|
+
lib/net/ssh/transport/ctr.rb
|
51
|
+
lib/net/ssh/transport/hmac.rb
|
52
|
+
lib/net/ssh/transport/hmac/abstract.rb
|
53
|
+
lib/net/ssh/transport/hmac/md5.rb
|
54
|
+
lib/net/ssh/transport/hmac/md5_96.rb
|
55
|
+
lib/net/ssh/transport/hmac/none.rb
|
56
|
+
lib/net/ssh/transport/hmac/ripemd160.rb
|
57
|
+
lib/net/ssh/transport/hmac/sha1.rb
|
58
|
+
lib/net/ssh/transport/hmac/sha1_96.rb
|
59
|
+
lib/net/ssh/transport/hmac/sha2_256.rb
|
60
|
+
lib/net/ssh/transport/hmac/sha2_256_96.rb
|
61
|
+
lib/net/ssh/transport/hmac/sha2_512.rb
|
62
|
+
lib/net/ssh/transport/hmac/sha2_512_96.rb
|
63
|
+
lib/net/ssh/transport/identity_cipher.rb
|
64
|
+
lib/net/ssh/transport/key_expander.rb
|
65
|
+
lib/net/ssh/transport/kex.rb
|
66
|
+
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
67
|
+
lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb
|
68
|
+
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
69
|
+
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb
|
70
|
+
lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb
|
71
|
+
lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb
|
72
|
+
lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb
|
73
|
+
lib/net/ssh/transport/openssl.rb
|
74
|
+
lib/net/ssh/transport/packet_stream.rb
|
75
|
+
lib/net/ssh/transport/server_version.rb
|
76
|
+
lib/net/ssh/transport/session.rb
|
77
|
+
lib/net/ssh/transport/state.rb
|
78
|
+
lib/net/ssh/verifiers/lenient.rb
|
79
|
+
lib/net/ssh/verifiers/null.rb
|
80
|
+
lib/net/ssh/verifiers/strict.rb
|
81
|
+
lib/net/ssh/version.rb
|
82
|
+
net-ssh.gemspec
|
83
|
+
setup.rb
|
84
|
+
support/arcfour_check.rb
|
85
|
+
support/ssh_tunnel_bug.rb
|
86
|
+
test/authentication/methods/common.rb
|
87
|
+
test/authentication/methods/test_abstract.rb
|
88
|
+
test/authentication/methods/test_hostbased.rb
|
89
|
+
test/authentication/methods/test_keyboard_interactive.rb
|
90
|
+
test/authentication/methods/test_password.rb
|
91
|
+
test/authentication/methods/test_publickey.rb
|
92
|
+
test/authentication/test_agent.rb
|
93
|
+
test/authentication/test_key_manager.rb
|
94
|
+
test/authentication/test_session.rb
|
95
|
+
test/common.rb
|
96
|
+
test/configs/eqsign
|
97
|
+
test/configs/exact_match
|
98
|
+
test/configs/host_plus
|
99
|
+
test/configs/multihost
|
100
|
+
test/configs/wild_cards
|
101
|
+
test/connection/test_channel.rb
|
102
|
+
test/connection/test_session.rb
|
103
|
+
test/test_all.rb
|
104
|
+
test/test_buffer.rb
|
105
|
+
test/test_buffered_io.rb
|
106
|
+
test/test_config.rb
|
107
|
+
test/test_key_factory.rb
|
108
|
+
test/transport/hmac/test_md5.rb
|
109
|
+
test/transport/hmac/test_md5_96.rb
|
110
|
+
test/transport/hmac/test_none.rb
|
111
|
+
test/transport/hmac/test_ripemd160.rb
|
112
|
+
test/transport/hmac/test_sha1.rb
|
113
|
+
test/transport/hmac/test_sha1_96.rb
|
114
|
+
test/transport/hmac/test_sha2_256.rb
|
115
|
+
test/transport/hmac/test_sha2_256_96.rb
|
116
|
+
test/transport/hmac/test_sha2_512.rb
|
117
|
+
test/transport/hmac/test_sha2_512_96.rb
|
118
|
+
test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
119
|
+
test/transport/kex/test_diffie_hellman_group14_sha1.rb
|
120
|
+
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
121
|
+
test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
|
122
|
+
test/transport/kex/test_ecdh_sha2_nistp256.rb
|
123
|
+
test/transport/kex/test_ecdh_sha2_nistp384.rb
|
124
|
+
test/transport/kex/test_ecdh_sha2_nistp521.rb
|
125
|
+
test/transport/test_algorithms.rb
|
126
|
+
test/transport/test_cipher_factory.rb
|
127
|
+
test/transport/test_hmac.rb
|
128
|
+
test/transport/test_identity_cipher.rb
|
129
|
+
test/transport/test_packet_stream.rb
|
130
|
+
test/transport/test_server_version.rb
|
131
|
+
test/transport/test_session.rb
|
132
|
+
test/transport/test_state.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,184 @@
|
|
1
|
+
= Net::SSH
|
2
|
+
|
3
|
+
* Docs: http://net-ssh.github.com/net-ssh
|
4
|
+
* Issues: http://net-ssh.lighthouseapp.com/
|
5
|
+
* Codes: http://github.com/net-ssh/net-ssh
|
6
|
+
* Email: net-ssh@solutious.com
|
7
|
+
|
8
|
+
== DESCRIPTION:
|
9
|
+
|
10
|
+
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.
|
11
|
+
|
12
|
+
== FEATURES:
|
13
|
+
|
14
|
+
* Execute processes on remote servers and capture their output
|
15
|
+
* Run multiple processes in parallel over a single SSH connection
|
16
|
+
* Support for SSH subsystems
|
17
|
+
* Forward local and remote ports via an SSH connection
|
18
|
+
|
19
|
+
== SYNOPSIS:
|
20
|
+
|
21
|
+
In a nutshell:
|
22
|
+
|
23
|
+
require 'net/ssh'
|
24
|
+
|
25
|
+
Net::SSH.start('host', 'user', :password => "password") do |ssh|
|
26
|
+
# capture all stderr and stdout output from a remote process
|
27
|
+
output = ssh.exec!("hostname")
|
28
|
+
|
29
|
+
# capture only stdout matching a particular pattern
|
30
|
+
stdout = ""
|
31
|
+
ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
|
32
|
+
stdout << data if stream == :stdout
|
33
|
+
end
|
34
|
+
puts stdout
|
35
|
+
|
36
|
+
# run multiple processes in parallel to completion
|
37
|
+
ssh.exec "sed ..."
|
38
|
+
ssh.exec "awk ..."
|
39
|
+
ssh.exec "rm -rf ..."
|
40
|
+
ssh.loop
|
41
|
+
|
42
|
+
# open a new channel and configure a minimal set of callbacks, then run
|
43
|
+
# the event loop until the channel finishes (closes)
|
44
|
+
channel = ssh.open_channel do |ch|
|
45
|
+
ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
|
46
|
+
raise "could not execute command" unless success
|
47
|
+
|
48
|
+
# "on_data" is called when the process writes something to stdout
|
49
|
+
ch.on_data do |c, data|
|
50
|
+
$STDOUT.print data
|
51
|
+
end
|
52
|
+
|
53
|
+
# "on_extended_data" is called when the process writes something to stderr
|
54
|
+
ch.on_extended_data do |c, type, data|
|
55
|
+
$STDERR.print data
|
56
|
+
end
|
57
|
+
|
58
|
+
ch.on_close { puts "done!" }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
channel.wait
|
63
|
+
|
64
|
+
# forward connections on local port 1234 to port 80 of www.capify.org
|
65
|
+
ssh.forward.local(1234, "www.capify.org", 80)
|
66
|
+
ssh.loop { true }
|
67
|
+
end
|
68
|
+
|
69
|
+
See Net::SSH for more documentation, and links to further information.
|
70
|
+
|
71
|
+
== REQUIREMENTS:
|
72
|
+
|
73
|
+
The only requirement you might be missing is the OpenSSL bindings for Ruby. These are built by default on most platforms, but you can verify that they're built and installed on your system by running the following command line:
|
74
|
+
|
75
|
+
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
76
|
+
|
77
|
+
If that spits out something like "OpenSSL 0.9.8g 19 Oct 2007", then you're set. If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support, or (if your platform supports it) installing the OpenSSL bindings separately.
|
78
|
+
|
79
|
+
Additionally: if you are going to be having Net::SSH prompt you for things like passwords or certificate passphrases, you'll want to have either the Highline (recommended) or Termios (unix systems only) gem installed, so that the passwords don't echo in clear text.
|
80
|
+
|
81
|
+
Lastly, if you want to run the tests or use any of the Rake tasks, you'll need:
|
82
|
+
|
83
|
+
* Echoe (for the Rakefile)
|
84
|
+
* Mocha (for the tests)
|
85
|
+
|
86
|
+
|
87
|
+
== INSTALL:
|
88
|
+
|
89
|
+
* gem install net-ssh (might need sudo privileges)
|
90
|
+
|
91
|
+
|
92
|
+
== ARCFOUR SUPPORT:
|
93
|
+
|
94
|
+
from Karl Varga:
|
95
|
+
|
96
|
+
Ruby's OpenSSL bindings always return a key length of 16 for RC4 ciphers, which means that when we try to use ARCFOUR256 or higher, Net::SSH generates keys which are consistently too short - 16 bytes as opposed to 32 bytes - resulting in the following error:
|
97
|
+
|
98
|
+
OpenSSL::CipherError: key length too short
|
99
|
+
|
100
|
+
My patch simply instructs Net::SSH to build keys of the the proper length, regardless of the required key length reported by OpenSSL.
|
101
|
+
|
102
|
+
You should also be aware that your OpenSSL C libraries may also contain this bug. I've updated to 0.9.8k, but according to this thread[https://bugzilla.mindrot.org/show_bug.cgi?id=1291], the bug existed as recently as 0.9.8e! I've manually taken a look at my header files and they look ok, which is what makes me think it's a bug in the Ruby implementation.
|
103
|
+
|
104
|
+
To see your OpenSSL version:
|
105
|
+
|
106
|
+
$ openssl version
|
107
|
+
OpenSSL 0.9.8k 25 Mar 2009
|
108
|
+
|
109
|
+
After installing this gem, verify that Net::SSH is generating keys of the correct length by running the script <tt>support/arcfour_check.rb</tt>:
|
110
|
+
|
111
|
+
$ ruby arcfour_support.rb
|
112
|
+
|
113
|
+
which should produce the following:
|
114
|
+
|
115
|
+
arcfour128: [16, 8] OpenSSL::Cipher::Cipher
|
116
|
+
arcfour256: [32, 8] OpenSSL::Cipher::Cipher
|
117
|
+
arcfour512: [64, 8] OpenSSL::Cipher::Cipher
|
118
|
+
|
119
|
+
|
120
|
+
== RUNNING TESTS
|
121
|
+
|
122
|
+
Run the test suite from the net-ssh directory with the following command:
|
123
|
+
|
124
|
+
ruby -Ilib -Itest -rrubygems test/test_all.rb
|
125
|
+
|
126
|
+
Run a single test file like this:
|
127
|
+
|
128
|
+
ruby -Ilib -Itest -rrubygems test/transport/test_server_version.rb
|
129
|
+
|
130
|
+
|
131
|
+
=== EXPECTED RESULTS
|
132
|
+
|
133
|
+
* Ruby 1.8: all tests pass
|
134
|
+
|
135
|
+
* Ruby 1.9: all tests pass
|
136
|
+
|
137
|
+
* JRuby 1.5: 99% tests pass (448 tests, 1846 assertions, 1 failures)
|
138
|
+
|
139
|
+
|
140
|
+
=== PORT FORWARDING TESTS
|
141
|
+
|
142
|
+
ruby -Ilib -Itest -rrubygems test/manual/test_forward.rb
|
143
|
+
|
144
|
+
test_forward.rb must be run separately from the test suite because
|
145
|
+
it requires authorizing your public SSH keys on you localhost.
|
146
|
+
|
147
|
+
If you already have keys you can do this:
|
148
|
+
|
149
|
+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
|
150
|
+
|
151
|
+
If you don't have keys see:
|
152
|
+
|
153
|
+
http://kimmo.suominen.com/docs/ssh/#ssh-keygen
|
154
|
+
|
155
|
+
You should now be able to login to your localhost with out
|
156
|
+
bring prompted for a password:
|
157
|
+
|
158
|
+
ssh localhost
|
159
|
+
|
160
|
+
|
161
|
+
== LICENSE:
|
162
|
+
|
163
|
+
(The MIT License)
|
164
|
+
|
165
|
+
Copyright (c) 2008 Jamis Buck
|
166
|
+
|
167
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
168
|
+
a copy of this software and associated documentation files (the
|
169
|
+
'Software'), to deal in the Software without restriction, including
|
170
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
171
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
172
|
+
permit persons to whom the Software is furnished to do so, subject to
|
173
|
+
the following conditions:
|
174
|
+
|
175
|
+
The above copyright notice and this permission notice shall be
|
176
|
+
included in all copies or substantial portions of the Software.
|
177
|
+
|
178
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
179
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
180
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
181
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
182
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
183
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
184
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|