kjvarga-net-ssh 2.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/CHANGELOG.rdoc +137 -0
  2. data/Manifest +104 -0
  3. data/README.rdoc +177 -0
  4. data/Rakefile +79 -0
  5. data/THANKS.rdoc +16 -0
  6. data/lib/net/ssh.rb +215 -0
  7. data/lib/net/ssh/authentication/agent.rb +176 -0
  8. data/lib/net/ssh/authentication/constants.rb +18 -0
  9. data/lib/net/ssh/authentication/key_manager.rb +193 -0
  10. data/lib/net/ssh/authentication/methods/abstract.rb +60 -0
  11. data/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
  12. data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
  13. data/lib/net/ssh/authentication/methods/password.rb +39 -0
  14. data/lib/net/ssh/authentication/methods/publickey.rb +92 -0
  15. data/lib/net/ssh/authentication/pageant.rb +183 -0
  16. data/lib/net/ssh/authentication/session.rb +134 -0
  17. data/lib/net/ssh/buffer.rb +340 -0
  18. data/lib/net/ssh/buffered_io.rb +149 -0
  19. data/lib/net/ssh/config.rb +181 -0
  20. data/lib/net/ssh/connection/channel.rb +625 -0
  21. data/lib/net/ssh/connection/constants.rb +33 -0
  22. data/lib/net/ssh/connection/session.rb +596 -0
  23. data/lib/net/ssh/connection/term.rb +178 -0
  24. data/lib/net/ssh/errors.rb +85 -0
  25. data/lib/net/ssh/key_factory.rb +102 -0
  26. data/lib/net/ssh/known_hosts.rb +129 -0
  27. data/lib/net/ssh/loggable.rb +61 -0
  28. data/lib/net/ssh/packet.rb +102 -0
  29. data/lib/net/ssh/prompt.rb +93 -0
  30. data/lib/net/ssh/proxy/errors.rb +14 -0
  31. data/lib/net/ssh/proxy/http.rb +94 -0
  32. data/lib/net/ssh/proxy/socks4.rb +70 -0
  33. data/lib/net/ssh/proxy/socks5.rb +129 -0
  34. data/lib/net/ssh/ruby_compat.rb +7 -0
  35. data/lib/net/ssh/service/forward.rb +267 -0
  36. data/lib/net/ssh/test.rb +89 -0
  37. data/lib/net/ssh/test/channel.rb +129 -0
  38. data/lib/net/ssh/test/extensions.rb +152 -0
  39. data/lib/net/ssh/test/kex.rb +44 -0
  40. data/lib/net/ssh/test/local_packet.rb +51 -0
  41. data/lib/net/ssh/test/packet.rb +81 -0
  42. data/lib/net/ssh/test/remote_packet.rb +38 -0
  43. data/lib/net/ssh/test/script.rb +157 -0
  44. data/lib/net/ssh/test/socket.rb +59 -0
  45. data/lib/net/ssh/transport/algorithms.rb +384 -0
  46. data/lib/net/ssh/transport/cipher_factory.rb +90 -0
  47. data/lib/net/ssh/transport/constants.rb +30 -0
  48. data/lib/net/ssh/transport/hmac.rb +31 -0
  49. data/lib/net/ssh/transport/hmac/abstract.rb +78 -0
  50. data/lib/net/ssh/transport/hmac/md5.rb +12 -0
  51. data/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
  52. data/lib/net/ssh/transport/hmac/none.rb +15 -0
  53. data/lib/net/ssh/transport/hmac/sha1.rb +13 -0
  54. data/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
  55. data/lib/net/ssh/transport/identity_cipher.rb +55 -0
  56. data/lib/net/ssh/transport/kex.rb +13 -0
  57. data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
  58. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
  59. data/lib/net/ssh/transport/openssl.rb +128 -0
  60. data/lib/net/ssh/transport/packet_stream.rb +230 -0
  61. data/lib/net/ssh/transport/server_version.rb +69 -0
  62. data/lib/net/ssh/transport/session.rb +276 -0
  63. data/lib/net/ssh/transport/state.rb +206 -0
  64. data/lib/net/ssh/verifiers/lenient.rb +30 -0
  65. data/lib/net/ssh/verifiers/null.rb +12 -0
  66. data/lib/net/ssh/verifiers/strict.rb +53 -0
  67. data/lib/net/ssh/version.rb +62 -0
  68. data/net-ssh.gemspec +128 -0
  69. data/setup.rb +1585 -0
  70. data/test/authentication/methods/common.rb +28 -0
  71. data/test/authentication/methods/test_abstract.rb +51 -0
  72. data/test/authentication/methods/test_hostbased.rb +114 -0
  73. data/test/authentication/methods/test_keyboard_interactive.rb +98 -0
  74. data/test/authentication/methods/test_password.rb +50 -0
  75. data/test/authentication/methods/test_publickey.rb +127 -0
  76. data/test/authentication/test_agent.rb +205 -0
  77. data/test/authentication/test_key_manager.rb +105 -0
  78. data/test/authentication/test_session.rb +93 -0
  79. data/test/common.rb +106 -0
  80. data/test/configs/eqsign +3 -0
  81. data/test/configs/exact_match +8 -0
  82. data/test/configs/wild_cards +14 -0
  83. data/test/connection/test_channel.rb +452 -0
  84. data/test/connection/test_session.rb +488 -0
  85. data/test/test_all.rb +6 -0
  86. data/test/test_buffer.rb +336 -0
  87. data/test/test_buffered_io.rb +63 -0
  88. data/test/test_config.rb +84 -0
  89. data/test/test_key_factory.rb +67 -0
  90. data/test/transport/hmac/test_md5.rb +39 -0
  91. data/test/transport/hmac/test_md5_96.rb +25 -0
  92. data/test/transport/hmac/test_none.rb +34 -0
  93. data/test/transport/hmac/test_sha1.rb +34 -0
  94. data/test/transport/hmac/test_sha1_96.rb +25 -0
  95. data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
  96. data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
  97. data/test/transport/test_algorithms.rb +302 -0
  98. data/test/transport/test_cipher_factory.rb +171 -0
  99. data/test/transport/test_hmac.rb +34 -0
  100. data/test/transport/test_identity_cipher.rb +40 -0
  101. data/test/transport/test_packet_stream.rb +435 -0
  102. data/test/transport/test_server_version.rb +68 -0
  103. data/test/transport/test_session.rb +315 -0
  104. data/test/transport/test_state.rb +173 -0
  105. metadata +163 -0
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,137 @@
1
+ === (unreleased)
2
+
3
+ * Use unbuffered reads when negotiating the protocol version [Steven Hazel]
4
+
5
+
6
+ === 2.0.12 / 08 Jun 2009
7
+
8
+ * Applied patch for arcfour128 and arcfour256 support [Denis Bernard]
9
+
10
+
11
+ === 2.0.11 / 24 Feb 2009
12
+
13
+ * Add :key_data option for specifying raw private keys in PEM format [Alex Holems, Andrew Babkin]
14
+
15
+
16
+ === 2.0.10 / 4 Feb 2009
17
+
18
+ * Added Net::SSH.configuration_for to make it easier to query the SSH configuration file(s) [Jamis Buck]
19
+
20
+
21
+ === 2.0.9 / 1 Feb 2009
22
+
23
+ * Specifying non-nil user argument overrides user in .ssh/config [Jamis Buck]
24
+
25
+ * Ignore requests for non-existent channels (workaround ssh server bug) [Jamis Buck]
26
+
27
+ * Add terminate! method for hard shutdown scenarios [Jamis Buck]
28
+
29
+ * Revert to pre-2.0.7 key-loading behavior by default, but load private-key if public-key doesn't exist [Jamis Buck]
30
+
31
+ * Make sure :passphrase option gets passed to key manager [Bob Cotton]
32
+
33
+
34
+ === 2.0.8 / 29 December 2008
35
+
36
+ * Fix private key change from 2.0.7 so that keys are loaded just-in-time, avoiding unecessary prompts from encrypted keys. [Jamis Buck]
37
+
38
+
39
+ === 2.0.7 / 29 December 2008
40
+
41
+ * Make key manager use private keys instead of requiring public key to exist [arilerner@mac.com]
42
+
43
+ * Fix failing tests [arilerner@mac.com]
44
+
45
+ * Don't include pageant when running under JRuby [Angel N. Sciortino]
46
+
47
+
48
+ === 2.0.6 / 6 December 2008
49
+
50
+ * Update the Manifest file so that the gem includes all necessary files [Jamis Buck]
51
+
52
+
53
+ === 2.0.5 / 6 December 2008
54
+
55
+ * Make the Pageant interface comply with more of the Socket interface to avoid related errors [Jamis Buck]
56
+
57
+ * Don't busy-wait on session close for remaining channels to close [Will Bryant]
58
+
59
+ * Ruby 1.9 compatibility [Jamis Buck]
60
+
61
+ * Fix Cipher#final to correctly flag a need for a cipher reset [Jamis Buck]
62
+
63
+
64
+ === 2.0.4 / 27 Aug 2008
65
+
66
+ * Added Connection::Session#closed? and Transport::Session#closed? [Jamis Buck]
67
+
68
+ * Numeric host names in .ssh/config are now parsed correct [Yanko Ivanov]
69
+
70
+ * Make sure the error raised when a public key file is malformed is more informative than a MethodMissing error [Jamis Buck]
71
+
72
+ * Cipher#reset is now called after Cipher#final, with the last n bytes used as the next initialization vector [Jamis Buck]
73
+
74
+
75
+ === 2.0.3 / 27 Jun 2008
76
+
77
+ * Make Net::SSH::Version comparable [Brian Candler]
78
+
79
+ * Fix errors in port forwarding when a channel could not be opened due to a typo in the exception name [Matthew Todd]
80
+
81
+ * 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]
82
+
83
+ * Correctly parse ssh_config entries with eq-sign delimiters [Jamis Buck]
84
+
85
+ * Ignore malformed ssh_config entries [Jamis Buck]
86
+
87
+ === 2.0.2 / 29 May 2008
88
+
89
+ * Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
90
+
91
+ * Fixed key truncation bug that caused hmacs other than SHA1 to fail with "corrupt hmac" errors [Jamis Buck]
92
+
93
+ * Fix detection and loading of public keys when the keys don't actually exist [David Dollar]
94
+
95
+
96
+ === 2.0.1 / 5 May 2008
97
+
98
+ * Teach Net::SSH about a handful of default key names [Jamis Buck]
99
+
100
+
101
+ === 2.0.0 / 1 May 2008
102
+
103
+ * Allow the :verbose argument to accept symbols (:debug, etc.) as well as Logger level constants (Logger::DEBUG, etc.) [Jamis Buck]
104
+
105
+
106
+ === 2.0 Preview Release 4 (1.99.3) / 19 Apr 2008
107
+
108
+ * Make sure HOME is set to something sane, even on OS's that don't set it by default [Jamis Buck]
109
+
110
+ * Add a :passphrase option to specify the passphrase to use with private keys [Francis Sullivan]
111
+
112
+ * Open a new auth agent connection for every auth-agent channel request [Jamis Buck]
113
+
114
+
115
+ === 2.0 Preview Release 3 (1.99.2) / 10 Apr 2008
116
+
117
+ * Session properties [Jamis Buck]
118
+
119
+ * Make channel open failure work with a callback so that failures can be handled similarly to successes [Jamis Buck]
120
+
121
+
122
+ === 2.0 Preview Release 2 (1.99.1) / 22 Mar 2008
123
+
124
+ * Partial support for ~/.ssh/config (and related) SSH configuration files [Daniel J. Berger, Jamis Buck]
125
+
126
+ * Added Net::SSH::Test to facilitate testing complex SSH state machines [Jamis Buck]
127
+
128
+ * Reworked Net::SSH::Prompt to use conditionally-selected modules [Jamis Buck, suggested by James Rosen]
129
+
130
+ * Added Channel#eof? and Channel#eof! [Jamis Buck]
131
+
132
+ * Fixed bug in strict host key verifier on cache miss [Mike Timm]
133
+
134
+
135
+ === 2.0 Preview Release 1 (1.99.0) / 21 Aug 2007
136
+
137
+ * First preview release of Net::SSH v2
data/Manifest ADDED
@@ -0,0 +1,104 @@
1
+ CHANGELOG.rdoc
2
+ Manifest
3
+ README.rdoc
4
+ Rakefile
5
+ THANKS.rdoc
6
+ lib/net/ssh.rb
7
+ lib/net/ssh/authentication/agent.rb
8
+ lib/net/ssh/authentication/constants.rb
9
+ lib/net/ssh/authentication/key_manager.rb
10
+ lib/net/ssh/authentication/methods/abstract.rb
11
+ lib/net/ssh/authentication/methods/hostbased.rb
12
+ lib/net/ssh/authentication/methods/keyboard_interactive.rb
13
+ lib/net/ssh/authentication/methods/password.rb
14
+ lib/net/ssh/authentication/methods/publickey.rb
15
+ lib/net/ssh/authentication/pageant.rb
16
+ lib/net/ssh/authentication/session.rb
17
+ lib/net/ssh/buffer.rb
18
+ lib/net/ssh/buffered_io.rb
19
+ lib/net/ssh/config.rb
20
+ lib/net/ssh/connection/channel.rb
21
+ lib/net/ssh/connection/constants.rb
22
+ lib/net/ssh/connection/session.rb
23
+ lib/net/ssh/connection/term.rb
24
+ lib/net/ssh/errors.rb
25
+ lib/net/ssh/key_factory.rb
26
+ lib/net/ssh/known_hosts.rb
27
+ lib/net/ssh/loggable.rb
28
+ lib/net/ssh/packet.rb
29
+ lib/net/ssh/prompt.rb
30
+ lib/net/ssh/proxy/errors.rb
31
+ lib/net/ssh/proxy/http.rb
32
+ lib/net/ssh/proxy/socks4.rb
33
+ lib/net/ssh/proxy/socks5.rb
34
+ lib/net/ssh/ruby_compat.rb
35
+ lib/net/ssh/service/forward.rb
36
+ lib/net/ssh/test.rb
37
+ lib/net/ssh/test/channel.rb
38
+ lib/net/ssh/test/extensions.rb
39
+ lib/net/ssh/test/kex.rb
40
+ lib/net/ssh/test/local_packet.rb
41
+ lib/net/ssh/test/packet.rb
42
+ lib/net/ssh/test/remote_packet.rb
43
+ lib/net/ssh/test/script.rb
44
+ lib/net/ssh/test/socket.rb
45
+ lib/net/ssh/transport/algorithms.rb
46
+ lib/net/ssh/transport/cipher_factory.rb
47
+ lib/net/ssh/transport/constants.rb
48
+ lib/net/ssh/transport/hmac.rb
49
+ lib/net/ssh/transport/hmac/abstract.rb
50
+ lib/net/ssh/transport/hmac/md5.rb
51
+ lib/net/ssh/transport/hmac/md5_96.rb
52
+ lib/net/ssh/transport/hmac/none.rb
53
+ lib/net/ssh/transport/hmac/sha1.rb
54
+ lib/net/ssh/transport/hmac/sha1_96.rb
55
+ lib/net/ssh/transport/identity_cipher.rb
56
+ lib/net/ssh/transport/kex.rb
57
+ lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
58
+ lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
59
+ lib/net/ssh/transport/openssl.rb
60
+ lib/net/ssh/transport/packet_stream.rb
61
+ lib/net/ssh/transport/server_version.rb
62
+ lib/net/ssh/transport/session.rb
63
+ lib/net/ssh/transport/state.rb
64
+ lib/net/ssh/verifiers/lenient.rb
65
+ lib/net/ssh/verifiers/null.rb
66
+ lib/net/ssh/verifiers/strict.rb
67
+ lib/net/ssh/version.rb
68
+ net-ssh.gemspec
69
+ setup.rb
70
+ test/authentication/methods/common.rb
71
+ test/authentication/methods/test_abstract.rb
72
+ test/authentication/methods/test_hostbased.rb
73
+ test/authentication/methods/test_keyboard_interactive.rb
74
+ test/authentication/methods/test_password.rb
75
+ test/authentication/methods/test_publickey.rb
76
+ test/authentication/test_agent.rb
77
+ test/authentication/test_key_manager.rb
78
+ test/authentication/test_session.rb
79
+ test/common.rb
80
+ test/configs/eqsign
81
+ test/configs/exact_match
82
+ test/configs/wild_cards
83
+ test/connection/test_channel.rb
84
+ test/connection/test_session.rb
85
+ test/test_all.rb
86
+ test/test_buffer.rb
87
+ test/test_buffered_io.rb
88
+ test/test_config.rb
89
+ test/test_key_factory.rb
90
+ test/transport/hmac/test_md5.rb
91
+ test/transport/hmac/test_md5_96.rb
92
+ test/transport/hmac/test_none.rb
93
+ test/transport/hmac/test_sha1.rb
94
+ test/transport/hmac/test_sha1_96.rb
95
+ test/transport/kex/test_diffie_hellman_group1_sha1.rb
96
+ test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
97
+ test/transport/test_algorithms.rb
98
+ test/transport/test_cipher_factory.rb
99
+ test/transport/test_hmac.rb
100
+ test/transport/test_identity_cipher.rb
101
+ test/transport/test_packet_stream.rb
102
+ test/transport/test_server_version.rb
103
+ test/transport/test_session.rb
104
+ test/transport/test_state.rb
data/README.rdoc ADDED
@@ -0,0 +1,177 @@
1
+ = Foreword
2
+
3
+ This is a patched version of Ruby's Net::SSH implementation which works around a bug in Ruby's OpenSSL implementation. 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:
4
+
5
+ OpenSSL::CipherError: key length too short
6
+
7
+ My patch simply instructs Net::SSH to build keys of the the proper length, regardless of the required key length reported by OpenSSL.
8
+
9
+ Unfortunately I was not able to locate the bug in Ruby's OpenSSL implementation...to be honest I can't see where it invokes the underlying C OpenSSL libraries or where it defines the +key_len+ method on the +Cipher+ object.
10
+
11
+ 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.
12
+
13
+ To see your OpenSSL version:
14
+
15
+ $ openssl version
16
+ OpenSSL 0.9.8k 25 Mar 2009
17
+
18
+ After installing this gem, verify that Net::SSH is generating keys of the correct length. Open +irb+ and type the following:
19
+
20
+ require 'net/ssh'
21
+ a = Net::SSH::Transport::CipherFactory.get_lengths('arcfour256')
22
+ a = Net::SSH::Transport::CipherFactory.get('arcfour256', {:key => ([].fill('a', 0, 32).join) })
23
+ a = Net::SSH::Transport::CipherFactory.get_lengths('arcfour512')
24
+ a = Net::SSH::Transport::CipherFactory.get('arcfour512', {:key => ([].fill('a', 0, 64).join) })
25
+ a = Net::SSH::Transport::CipherFactory.get('arcfour256', {:key => ([].fill('a', 0, 16).join) })
26
+
27
+ This should output:
28
+
29
+ > require 'net/ssh'
30
+ => []
31
+ >> a = Net::SSH::Transport::CipherFactory.get_lengths('arcfour256')
32
+ => [32, 8]
33
+ >> a = Net::SSH::Transport::CipherFactory.get('arcfour256', {:key => ([].fill('a', 0, 32).join) })
34
+ => #<OpenSSL::Cipher::Cipher:0x261bf3c>
35
+ >> a = Net::SSH::Transport::CipherFactory.get_lengths('arcfour512')
36
+ => [64, 8]
37
+ >> a = Net::SSH::Transport::CipherFactory.get('arcfour512', {:key => ([].fill('a', 0, 64).join) })
38
+ => #<OpenSSL::Cipher::Cipher:0x260f14c>
39
+ >> a = Net::SSH::Transport::CipherFactory.get('arcfour256', {:key => ([].fill('a', 0, 16).join) })
40
+ NoMethodError: You have a nil object when you didn't expect it!
41
+ You might have expected an instance of Array.
42
+ The error occurred while evaluating nil.+
43
+ from /Library/Ruby/Gems/1.8/gems/net-ssh-2.0.12/lib/net/ssh/transport/cipher_factory.rb:81:in `make_key'
44
+ from /Library/Ruby/Gems/1.8/gems/net-ssh-2.0.12/lib/net/ssh/transport/cipher_factory.rb:49:in `get'
45
+ from (irb):12
46
+
47
+ The last exception is because the key isn't long enough. It's not pretty, and not informative, but that's life :)
48
+
49
+ = Net::SSH
50
+
51
+ * http://net-ssh.rubyforge.org/ssh
52
+
53
+ == DESCRIPTION:
54
+
55
+ 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.
56
+
57
+ == FEATURES:
58
+
59
+ * Execute processes on remote servers and capture their output
60
+ * Run multiple processes in parallel over a single SSH connection
61
+ * Support for SSH subsystems
62
+ * Forward local and remote ports via an SSH connection
63
+ * Supports ARCFOUR256 and ARCFOUR512 ciphers
64
+
65
+ == SYNOPSIS:
66
+
67
+ In a nutshell:
68
+
69
+ require 'net/ssh'
70
+
71
+ Net::SSH.start('host', 'user', :password => "password") do |ssh|
72
+ # capture all stderr and stdout output from a remote process
73
+ output = ssh.exec!("hostname")
74
+
75
+ # capture only stdout matching a particular pattern
76
+ stdout = ""
77
+ ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
78
+ stdout << data if stream == :stdout
79
+ end
80
+ puts stdout
81
+
82
+ # run multiple processes in parallel to completion
83
+ ssh.exec "sed ..."
84
+ ssh.exec "awk ..."
85
+ ssh.exec "rm -rf ..."
86
+ ssh.loop
87
+
88
+ # open a new channel and configure a minimal set of callbacks, then run
89
+ # the event loop until the channel finishes (closes)
90
+ channel = ssh.open_channel do |ch|
91
+ ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
92
+ raise "could not execute command" unless success
93
+
94
+ # "on_data" is called when the process writes something to stdout
95
+ ch.on_data do |c, data|
96
+ $STDOUT.print data
97
+ end
98
+
99
+ # "on_extended_data" is called when the process writes something to stderr
100
+ ch.on_extended_data do |c, type, data|
101
+ $STDERR.print data
102
+ end
103
+
104
+ ch.on_close { puts "done!" }
105
+ end
106
+ end
107
+
108
+ channel.wait
109
+
110
+ # forward connections on local port 1234 to port 80 of www.capify.org
111
+ ssh.forward.local(1234, "www.capify.org", 80)
112
+ ssh.loop { true }
113
+ end
114
+
115
+ See Net::SSH for more documentation, and links to further information.
116
+
117
+ == REQUIREMENTS:
118
+
119
+ 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:
120
+
121
+ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ == INSTALL:
128
+
129
+ GitHub should automatically build this Gem, so you should be able to do
130
+
131
+ gem install kjvarga-net-ssh (might need sudo privileges)
132
+
133
+ For this you require GitHub to be in your Gem sources. You can add it with
134
+
135
+ gem sources -a http://gems.github.com
136
+
137
+ Alternatively you can download and build it.
138
+
139
+ == BUILD:
140
+
141
+ Requirements
142
+
143
+ * Echoe (for the Rakefile)
144
+ * Mocha (for the tests)
145
+ * mislav-hanna (the Hanna gem from Mislav's repo on Github)
146
+
147
+ Dowload a tarball or otherwise checkout the code to a local directory and +cd+ to that directory. The following commands will build and install the gem.
148
+
149
+ gem sources -a http://gems.github.com
150
+ gem install mislav-hanna echoe
151
+ gem build net-ssh.gemspec
152
+ gem install net-ssh-2.0.12.gem
153
+
154
+ == LICENSE:
155
+
156
+ (The MIT License)
157
+
158
+ Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
159
+
160
+ Permission is hereby granted, free of charge, to any person obtaining
161
+ a copy of this software and associated documentation files (the
162
+ 'Software'), to deal in the Software without restriction, including
163
+ without limitation the rights to use, copy, modify, merge, publish,
164
+ distribute, sublicense, and/or sell copies of the Software, and to
165
+ permit persons to whom the Software is furnished to do so, subject to
166
+ the following conditions:
167
+
168
+ The above copyright notice and this permission notice shall be
169
+ included in all copies or substantial portions of the Software.
170
+
171
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
172
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
173
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
174
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
175
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
176
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
177
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,79 @@
1
+ require 'rubygems'
2
+ require 'rake/clean'
3
+ require 'rake/gempackagetask'
4
+ require 'hanna/rdoctask'
5
+ require 'fileutils'
6
+ include FileUtils
7
+
8
+ task :default => :package
9
+
10
+ # CONFIG =============================================================
11
+
12
+ # Change the following according to your needs
13
+ README = "README.rdoc"
14
+ CHANGES = "CHANGELOG.rdoc"
15
+ THANKS = 'THANKS.rdoc'
16
+
17
+ # Files and directories to be deleted when you run "rake clean"
18
+ CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
19
+
20
+ # Virginia assumes your project and gemspec have the same name
21
+ name = 'net-ssh'
22
+ load "#{name}.gemspec"
23
+ version = @spec.version
24
+
25
+ # That's it! The following defaults should allow you to get started
26
+ # on other things.
27
+
28
+
29
+ # TESTS/SPECS =========================================================
30
+
31
+
32
+
33
+ # INSTALL =============================================================
34
+
35
+ Rake::GemPackageTask.new(@spec) do |p|
36
+ p.need_tar = true if RUBY_PLATFORM !~ /mswin/
37
+ end
38
+
39
+ task :release => [ :rdoc, :package ]
40
+ task :install => [ :rdoc, :package ] do
41
+ sh %{sudo gem install pkg/#{name}-#{version}.gem}
42
+ end
43
+ task :uninstall => [ :clean ] do
44
+ sh %{sudo gem uninstall #{name}}
45
+ end
46
+
47
+
48
+ # RUBYFORGE RELEASE / PUBLISH TASKS ==================================
49
+
50
+ if @spec.rubyforge_project
51
+ desc 'Publish website to rubyforge'
52
+ task 'publish:rdoc' => 'doc/index.html' do
53
+ sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
54
+ end
55
+
56
+ desc 'Public release to rubyforge'
57
+ task 'publish:gem' => [:package] do |t|
58
+ sh <<-end
59
+ rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
60
+ rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
61
+ end
62
+ end
63
+ end
64
+
65
+
66
+
67
+ # RUBY DOCS TASK ==================================
68
+
69
+ Rake::RDocTask.new do |t|
70
+ t.rdoc_dir = 'doc'
71
+ t.title = @spec.summary
72
+ t.options << '--line-numbers' << '-A cattr_accessor=object'
73
+ t.options << '--charset' << 'utf-8'
74
+ t.rdoc_files.include(README)
75
+ t.rdoc_files.include(CHANGES)
76
+ t.rdoc_files.include(THANKS)
77
+ t.rdoc_files.include('lib/**/*.rb')
78
+ end
79
+