net-ssh 5.2.0 → 6.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +7 -4
  6. data/.rubocop_todo.yml +389 -379
  7. data/.travis.yml +13 -14
  8. data/CHANGES.txt +7 -0
  9. data/README.md +286 -0
  10. data/Rakefile +1 -2
  11. data/appveyor.yml +4 -2
  12. data/lib/net/ssh/authentication/key_manager.rb +7 -3
  13. data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +3 -1
  14. data/lib/net/ssh/authentication/pub_key_fingerprint.rb +0 -1
  15. data/lib/net/ssh/authentication/session.rb +2 -6
  16. data/lib/net/ssh/buffer.rb +1 -9
  17. data/lib/net/ssh/config.rb +25 -10
  18. data/lib/net/ssh/connection/channel.rb +7 -3
  19. data/lib/net/ssh/connection/session.rb +7 -3
  20. data/lib/net/ssh/key_factory.rb +6 -8
  21. data/lib/net/ssh/known_hosts.rb +26 -29
  22. data/lib/net/ssh/service/forward.rb +2 -1
  23. data/lib/net/ssh/test.rb +3 -2
  24. data/lib/net/ssh/transport/algorithms.rb +67 -42
  25. data/lib/net/ssh/transport/cipher_factory.rb +11 -27
  26. data/lib/net/ssh/transport/constants.rb +10 -6
  27. data/lib/net/ssh/transport/ctr.rb +1 -7
  28. data/lib/net/ssh/transport/hmac.rb +15 -13
  29. data/lib/net/ssh/transport/hmac/abstract.rb +16 -0
  30. data/lib/net/ssh/transport/hmac/sha2_256.rb +7 -11
  31. data/lib/net/ssh/transport/hmac/sha2_256_96.rb +4 -8
  32. data/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
  33. data/lib/net/ssh/transport/hmac/sha2_512.rb +6 -9
  34. data/lib/net/ssh/transport/hmac/sha2_512_96.rb +4 -8
  35. data/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
  36. data/lib/net/ssh/transport/kex.rb +13 -11
  37. data/lib/net/ssh/transport/kex/abstract.rb +123 -0
  38. data/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
  39. data/lib/net/ssh/transport/kex/curve25519_sha256.rb +38 -0
  40. data/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
  41. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +1 -15
  42. data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +9 -118
  43. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +0 -6
  44. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +5 -9
  45. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +18 -79
  46. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +5 -4
  47. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +5 -4
  48. data/lib/net/ssh/transport/openssl.rb +104 -107
  49. data/lib/net/ssh/transport/packet_stream.rb +44 -10
  50. data/lib/net/ssh/transport/state.rb +1 -1
  51. data/lib/net/ssh/version.rb +3 -3
  52. data/net-ssh.gemspec +8 -6
  53. metadata +35 -16
  54. metadata.gz.sig +0 -0
  55. data/Gemfile.noed25519.lock +0 -41
  56. data/README.rdoc +0 -194
  57. data/support/arcfour_check.rb +0 -20
metadata.gz.sig CHANGED
Binary file
@@ -1,41 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- net-ssh (4.2.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.3.0)
10
- metaclass (0.0.4)
11
- minitest (5.10.3)
12
- mocha (1.3.0)
13
- metaclass (~> 0.0.1)
14
- parser (2.4.0.2)
15
- ast (~> 2.3)
16
- powerpack (0.1.1)
17
- rainbow (2.2.2)
18
- rake
19
- rake (12.3.0)
20
- rubocop (0.47.1)
21
- parser (>= 2.3.3.1, < 3.0)
22
- powerpack (~> 0.1)
23
- rainbow (>= 1.99.1, < 3.0)
24
- ruby-progressbar (~> 1.7)
25
- unicode-display_width (~> 1.0, >= 1.0.1)
26
- ruby-progressbar (1.9.0)
27
- unicode-display_width (1.3.0)
28
-
29
- PLATFORMS
30
- ruby
31
-
32
- DEPENDENCIES
33
- bundler (~> 1.11)
34
- minitest (~> 5.10)
35
- mocha (>= 1.2.1)
36
- net-ssh!
37
- rake (~> 12.0)
38
- rubocop (~> 0.47.0)
39
-
40
- BUNDLED WITH
41
- 1.14.6
@@ -1,194 +0,0 @@
1
- {<img src="https://badge.fury.io/rb/net-ssh.svg" alt="Gem Version" />}[https://badge.fury.io/rb/net-ssh]
2
- {<img src="https://badges.gitter.im/net-ssh/net-ssh.svg" alt="Join the chat at https://gitter.im/net-ssh/net-ssh">}[https://gitter.im/net-ssh/net-ssh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
3
- {<img src="https://travis-ci.org/net-ssh/net-ssh.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/net-ssh/net-ssh]
4
- {<img src="https://codecov.io/gh/net-ssh/net-ssh/branch/master/graph/badge.svg" alt="Coverage status" />}[https://codecov.io/gh/net-ssh/net-ssh]
5
- {<img src="https://opencollective.com/net-ssh/backers/badge.svg" alt="Backers on Open Collective" />}[#backers]
6
- {<img src="https://opencollective.com/net-ssh/sponsors/badge.svg" alt="Sponsors on Open Collective" />}[#sponsors]
7
-
8
-
9
- = Net::SSH 5.x
10
-
11
- * Docs: http://net-ssh.github.com/net-ssh
12
- * Issues: https://github.com/net-ssh/net-ssh/issues
13
- * Codes: https://github.com/net-ssh/net-ssh
14
- * Email: net-ssh@solutious.com
15
-
16
- <em>As of v2.6.4, all gem releases are signed. See INSTALL.</em>
17
-
18
- == DESCRIPTION:
19
-
20
- 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.
21
-
22
- == FEATURES:
23
-
24
- * Execute processes on remote servers and capture their output
25
- * Run multiple processes in parallel over a single SSH connection
26
- * Support for SSH subsystems
27
- * Forward local and remote ports via an SSH connection
28
-
29
- == SYNOPSIS:
30
-
31
- In a nutshell:
32
-
33
- require 'net/ssh'
34
-
35
- Net::SSH.start('host', 'user', password: "password") do |ssh|
36
- # capture all stderr and stdout output from a remote process
37
- output = ssh.exec!("hostname")
38
- puts output
39
-
40
- # capture only stdout matching a particular pattern
41
- stdout = ""
42
- ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
43
- stdout << data if stream == :stdout
44
- end
45
- puts stdout
46
-
47
- # run multiple processes in parallel to completion
48
- ssh.exec "sed ..."
49
- ssh.exec "awk ..."
50
- ssh.exec "rm -rf ..."
51
- ssh.loop
52
-
53
- # open a new channel and configure a minimal set of callbacks, then run
54
- # the event loop until the channel finishes (closes)
55
- channel = ssh.open_channel do |ch|
56
- ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
57
- raise "could not execute command" unless success
58
-
59
- # "on_data" is called when the process writes something to stdout
60
- ch.on_data do |c, data|
61
- $stdout.print data
62
- end
63
-
64
- # "on_extended_data" is called when the process writes something to stderr
65
- ch.on_extended_data do |c, type, data|
66
- $stderr.print data
67
- end
68
-
69
- ch.on_close { puts "done!" }
70
- end
71
- end
72
-
73
- channel.wait
74
-
75
- # forward connections on local port 1234 to port 80 of www.capify.org
76
- ssh.forward.local(1234, "www.capify.org", 80)
77
- ssh.loop { true }
78
- end
79
-
80
- See Net::SSH for more documentation, and links to further information.
81
-
82
- == REQUIREMENTS:
83
-
84
- 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:
85
-
86
- ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
87
-
88
- 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.
89
-
90
- Lastly, if you want to run the tests or use any of the Rake tasks, you'll need Mocha and other dependencies listed in Gemfile
91
-
92
-
93
- == INSTALL:
94
-
95
- * gem install net-ssh (might need sudo privileges)
96
-
97
- NOTE: If you are running on jruby on windows you need to install jruby-pageant manually (gemspec doesn't allow for platform specific dependencies).
98
-
99
- However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the signature[http://docs.rubygems.org/read/chapter/21]. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
100
-
101
- # Add the public key as a trusted certificate
102
- # (You only need to do this once)
103
- $ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
104
- $ gem cert --add net-ssh-public_cert.pem
105
-
106
- Then, when install the gem, do so with high security:
107
-
108
- $ gem install net-ssh -P HighSecurity
109
-
110
- If you don't add the public key, you'll see an error like "Couldn't verify data signature". If you're still having trouble let me know and I'll give you a hand.
111
-
112
- For ed25519 public key auth support your bundle file should contain ```ed25519```, ```bcrypt_pbkdf``` dependencies.
113
-
114
- == RUBY SUPPORT
115
-
116
- * Ruby 1.8.x is supported up until the net-ssh 2.5.1 release.
117
- * Ruby 1.9.x is supported up until the net-ssh 2.9.x release.
118
- * See {net-ssh.gemspec}[https://github.com/net-ssh/net-ssh/blob/master/net-ssh.gemspec] for current versions ruby requirements
119
-
120
- == RUNNING TESTS
121
-
122
- Run the test suite from the net-ssh directory with the following command:
123
-
124
- bundle exec rake test
125
-
126
- Run a single test file like this:
127
-
128
- ruby -Ilib -Itest test/transport/test_server_version.rb
129
-
130
- To run integration tests see test/integration/README.txt
131
-
132
- === BUILDING GEM
133
-
134
- rake build
135
-
136
- === GEM SIGNING (for maintainers)
137
-
138
- If you have the net-ssh private signing key, you will be able to create signed release builds. Make sure the private key path matches the `signing_key` path set in `net-ssh.gemspec` and tell rake to sign the gem by setting the `NET_SSH_BUILDGEM_SIGNED` flag:
139
-
140
- NET_SSH_BUILDGEM_SIGNED=true rake build
141
-
142
- For time to time, the public certificate associated to the private key needs to be renewed. You can do this with the following command:
143
-
144
- gem cert --build netssh@solutious.com --private-key path/2/net-ssh-private_key.pem
145
- mv gem-public_cert.pem net-ssh-public_cert.pem
146
- gem cert --add net-ssh-public_cert.pem
147
-
148
- == CREDITS
149
-
150
- === Contributors
151
-
152
- This project exists thanks to all the people who contribute.
153
-
154
- {<img src="https://opencollective.com/net-ssh/contributors.svg?width=890&button=false" />}["graphs/contributors"]
155
-
156
-
157
- === Backers
158
-
159
- Thank you to all our backers! 🙏 {Become a backer}[https://opencollective.com/net-ssh#backer)]
160
-
161
- {<img src="https://opencollective.com/net-ssh/backers.svg?width=890”>}["https://opencollective.com/net-ssh#backers"]
162
-
163
- === Sponsors
164
-
165
- Support this project by becoming a sponsor. Your logo will show up here with a link to your website. {Become a sponsor}[https://opencollective.com/net-ssh#sponsor]
166
- {<img src="https://opencollective.com/net-ssh/sponsor/0/avatar.svg" alt="Sponsor" />}[https://opencollective.com/net-ssh/sponsor/0/website]
167
-
168
-
169
-
170
-
171
- == LICENSE:
172
-
173
- (The MIT License)
174
-
175
- Copyright (c) 2008 Jamis Buck
176
-
177
- Permission is hereby granted, free of charge, to any person obtaining
178
- a copy of this software and associated documentation files (the
179
- 'Software'), to deal in the Software without restriction, including
180
- without limitation the rights to use, copy, modify, merge, publish,
181
- distribute, sublicense, and/or sell copies of the Software, and to
182
- permit persons to whom the Software is furnished to do so, subject to
183
- the following conditions:
184
-
185
- The above copyright notice and this permission notice shall be
186
- included in all copies or substantial portions of the Software.
187
-
188
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
189
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
190
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
191
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
192
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
193
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
194
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,20 +0,0 @@
1
-
2
- require 'net/ssh'
3
-
4
- # ARCFOUR CHECK
5
- #
6
- # Usage:
7
- # $ ruby support/arcfour_check.rb
8
- #
9
- # Expected Output:
10
- # arcfour128: [16, 8] OpenSSL::Cipher::Cipher
11
- # arcfour256: [32, 8] OpenSSL::Cipher::Cipher
12
- # arcfour512: [64, 8] OpenSSL::Cipher::Cipher
13
-
14
- [['arcfour128', 16], ['arcfour256', 32], ['arcfour512', 64]].each do |cipher|
15
- print "#{cipher[0]}: "
16
- a = Net::SSH::Transport::CipherFactory.get_lengths(cipher[0])
17
- b = Net::SSH::Transport::CipherFactory.get(cipher[0], key: ([].fill('x', 0, cipher[1]).join))
18
- puts "#{a} #{b.class}"
19
- end
20
-