net-ssh 2.9.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +6 -0
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +1129 -0
- data/.travis.yml +41 -5
- data/CHANGES.txt +133 -1
- data/Gemfile +13 -0
- data/Gemfile.norbnacl +10 -0
- data/Gemfile.norbnacl.lock +41 -0
- data/ISSUE_TEMPLATE.md +30 -0
- data/README.rdoc +26 -81
- data/Rakefile +63 -45
- data/appveyor.yml +51 -0
- data/lib/net/ssh/authentication/agent.rb +174 -14
- data/lib/net/ssh/authentication/ed25519.rb +137 -0
- data/lib/net/ssh/authentication/ed25519_loader.rb +21 -0
- data/lib/net/ssh/authentication/key_manager.rb +36 -30
- data/lib/net/ssh/authentication/methods/abstract.rb +4 -0
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +16 -9
- data/lib/net/ssh/authentication/methods/password.rb +17 -4
- data/lib/net/ssh/authentication/pageant.rb +166 -45
- data/lib/net/ssh/authentication/session.rb +3 -2
- data/lib/net/ssh/buffer.rb +49 -10
- data/lib/net/ssh/buffered_io.rb +17 -12
- data/lib/net/ssh/config.rb +39 -8
- data/lib/net/ssh/connection/channel.rb +42 -20
- data/lib/net/ssh/connection/event_loop.rb +114 -0
- data/lib/net/ssh/connection/keepalive.rb +2 -2
- data/lib/net/ssh/connection/session.rb +120 -34
- data/lib/net/ssh/errors.rb +6 -6
- data/lib/net/ssh/key_factory.rb +49 -43
- data/lib/net/ssh/known_hosts.rb +49 -3
- data/lib/net/ssh/prompt.rb +47 -78
- data/lib/net/ssh/proxy/command.rb +31 -5
- data/lib/net/ssh/proxy/http.rb +15 -11
- data/lib/net/ssh/proxy/https.rb +49 -0
- data/lib/net/ssh/proxy/socks4.rb +2 -1
- data/lib/net/ssh/proxy/socks5.rb +3 -2
- data/lib/net/ssh/ruby_compat.rb +2 -29
- data/lib/net/ssh/service/forward.rb +2 -2
- data/lib/net/ssh/test/channel.rb +7 -0
- data/lib/net/ssh/test/extensions.rb +17 -0
- data/lib/net/ssh/test/kex.rb +4 -4
- data/lib/net/ssh/test/packet.rb +18 -2
- data/lib/net/ssh/test/script.rb +16 -2
- data/lib/net/ssh/test/socket.rb +1 -1
- data/lib/net/ssh/test.rb +5 -5
- data/lib/net/ssh/transport/algorithms.rb +92 -75
- data/lib/net/ssh/transport/cipher_factory.rb +19 -26
- data/lib/net/ssh/transport/ctr.rb +7 -9
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +20 -9
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +5 -3
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +1 -1
- data/lib/net/ssh/transport/key_expander.rb +1 -0
- data/lib/net/ssh/transport/openssl.rb +1 -1
- data/lib/net/ssh/transport/packet_stream.rb +11 -3
- data/lib/net/ssh/transport/server_version.rb +13 -6
- data/lib/net/ssh/transport/session.rb +20 -10
- data/lib/net/ssh/transport/state.rb +1 -1
- data/lib/net/ssh/verifiers/secure.rb +8 -10
- data/lib/net/ssh/version.rb +4 -4
- data/lib/net/ssh.rb +62 -14
- data/net-ssh-public_cert.pem +19 -18
- data/net-ssh.gemspec +34 -194
- data/support/arcfour_check.rb +1 -1
- data/support/ssh_tunnel_bug.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +125 -109
- metadata.gz.sig +0 -0
- data/Rudyfile +0 -96
- data/lib/net/ssh/authentication/agent/java_pageant.rb +0 -85
- data/lib/net/ssh/authentication/agent/socket.rb +0 -178
- data/setup.rb +0 -1585
- data/test/README.txt +0 -47
- data/test/authentication/methods/common.rb +0 -28
- data/test/authentication/methods/test_abstract.rb +0 -51
- data/test/authentication/methods/test_hostbased.rb +0 -114
- data/test/authentication/methods/test_keyboard_interactive.rb +0 -100
- data/test/authentication/methods/test_none.rb +0 -41
- data/test/authentication/methods/test_password.rb +0 -95
- data/test/authentication/methods/test_publickey.rb +0 -148
- data/test/authentication/test_agent.rb +0 -224
- data/test/authentication/test_key_manager.rb +0 -227
- data/test/authentication/test_session.rb +0 -107
- data/test/common.rb +0 -108
- data/test/configs/auth_off +0 -5
- data/test/configs/auth_on +0 -4
- data/test/configs/empty +0 -0
- data/test/configs/eqsign +0 -3
- data/test/configs/exact_match +0 -8
- data/test/configs/host_plus +0 -10
- data/test/configs/multihost +0 -4
- data/test/configs/negative_match +0 -6
- data/test/configs/nohost +0 -19
- data/test/configs/numeric_host +0 -4
- data/test/configs/send_env +0 -2
- data/test/configs/substitutes +0 -8
- data/test/configs/wild_cards +0 -14
- data/test/connection/test_channel.rb +0 -467
- data/test/connection/test_session.rb +0 -543
- data/test/known_hosts/github +0 -1
- data/test/manual/test_forward.rb +0 -285
- data/test/manual/test_pageant.rb +0 -37
- data/test/start/test_connection.rb +0 -53
- data/test/start/test_options.rb +0 -43
- data/test/start/test_transport.rb +0 -28
- data/test/test_all.rb +0 -11
- data/test/test_buffer.rb +0 -433
- data/test/test_buffered_io.rb +0 -63
- data/test/test_config.rb +0 -221
- data/test/test_key_factory.rb +0 -191
- data/test/test_known_hosts.rb +0 -13
- data/test/transport/hmac/test_md5.rb +0 -41
- data/test/transport/hmac/test_md5_96.rb +0 -27
- data/test/transport/hmac/test_none.rb +0 -34
- data/test/transport/hmac/test_ripemd160.rb +0 -36
- data/test/transport/hmac/test_sha1.rb +0 -36
- data/test/transport/hmac/test_sha1_96.rb +0 -27
- data/test/transport/hmac/test_sha2_256.rb +0 -37
- data/test/transport/hmac/test_sha2_256_96.rb +0 -27
- data/test/transport/hmac/test_sha2_512.rb +0 -37
- data/test/transport/hmac/test_sha2_512_96.rb +0 -27
- data/test/transport/kex/test_diffie_hellman_group14_sha1.rb +0 -13
- data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +0 -146
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +0 -92
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +0 -34
- data/test/transport/kex/test_ecdh_sha2_nistp256.rb +0 -161
- data/test/transport/kex/test_ecdh_sha2_nistp384.rb +0 -38
- data/test/transport/kex/test_ecdh_sha2_nistp521.rb +0 -38
- data/test/transport/test_algorithms.rb +0 -324
- data/test/transport/test_cipher_factory.rb +0 -443
- data/test/transport/test_hmac.rb +0 -34
- data/test/transport/test_identity_cipher.rb +0 -40
- data/test/transport/test_packet_stream.rb +0 -1761
- data/test/transport/test_server_version.rb +0 -78
- data/test/transport/test_session.rb +0 -331
- data/test/transport/test_state.rb +0 -181
data/support/ssh_tunnel_bug.rb
CHANGED
|
@@ -37,7 +37,7 @@ pass = ask("Password: ") { |q| q.echo = "*" }
|
|
|
37
37
|
puts "Configure your browser proxy to localhost:#{LOCAL_PORT}"
|
|
38
38
|
|
|
39
39
|
begin
|
|
40
|
-
session = Net::SSH.start(host, user, :
|
|
40
|
+
session = Net::SSH.start(host, user, password: pass)
|
|
41
41
|
session.forward.local(LOCAL_PORT, host, PROXY_PORT)
|
|
42
42
|
session.loop{true}
|
|
43
43
|
rescue => e
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,89 +1,168 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: net-ssh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
8
8
|
- Delano Mandelbaum
|
|
9
9
|
- Miklós Fazekas
|
|
10
|
-
autorequire:
|
|
11
|
-
bindir:
|
|
10
|
+
autorequire:
|
|
11
|
+
bindir: exe
|
|
12
12
|
cert_chain:
|
|
13
13
|
- |
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZuZXRz
|
|
16
|
+
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
|
17
|
+
b20wHhcNMTYxMjE1MTgwNTIyWhcNMTcxMjE1MTgwNTIyWjBBMQ8wDQYDVQQDDAZu
|
|
18
|
+
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
|
19
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
|
20
|
+
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
|
21
|
+
qVVyUrpr6lbH/XwoN5ljXm+bdCfmnjZvTCL2FTE6o+bcnaF0IsJyC0Q2B1fbWdXN
|
|
22
|
+
6Off1ZWoUk6We2BIM1bn6QJLxBpGyYhvOPXsYoqSuzDf2SJDDsWFZ8kV5ON13Ohm
|
|
23
|
+
JbBzn0oD8HF8FuYOewwsC0C1q4w7E5GtvHcQ5juweS7+RKsyDcVcVrLuNzoGRttS
|
|
24
|
+
KP4yMn+TzaXijyjRg7gECfJr3TGASaA4bQsILFGG5dAWcwO4OMrZedR7SHj/o0Kf
|
|
25
|
+
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
26
|
+
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
|
27
|
+
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
|
28
|
+
9w0BAQUFAAOCAQEATd8If+Ytmhf5lELy24j76ahGv64m518WTCdV2nIViGXB2BnV
|
|
29
|
+
uLQylGRb1rcgUS3Eh9TE28hqrfhotKS6a96qF9kN0mY2H6UwPWswJ+tj3gA1vLW8
|
|
30
|
+
wlZNlYGJ91Ig9zULPSbATyOOprUZyggy5p1260BaaI3LQYDeGJOSqpHCVu+TuMcy
|
|
31
|
+
k00ofiLT1crDSUl2WE/OIFK8AXpmd798AMsef8okHeoo+Dj7zCXn0VSimN+MO1mE
|
|
32
|
+
L4d54WIy4HkZCqQXoTSiK5HZMIdXkPk3F1bZdJ8Dy1sMRru0rUkkM5mW7TQ75mfW
|
|
33
|
+
Zp0QrZyNZhtitrXFbZneGRrIA/8G2Krft5Ly/A==
|
|
33
34
|
-----END CERTIFICATE-----
|
|
34
|
-
date:
|
|
35
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
|
35
36
|
dependencies:
|
|
36
37
|
- !ruby/object:Gem::Dependency
|
|
37
|
-
name: test-unit
|
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
|
39
39
|
requirements:
|
|
40
|
-
- -
|
|
40
|
+
- - "~>"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version:
|
|
42
|
+
version: 1.0.10
|
|
43
|
+
name: rbnacl-libsodium
|
|
44
|
+
prerelease: false
|
|
43
45
|
type: :development
|
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
- - "~>"
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: 1.0.10
|
|
51
|
+
- !ruby/object:Gem::Dependency
|
|
52
|
+
requirement: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - "~>"
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: 3.4.0
|
|
57
|
+
name: rbnacl
|
|
44
58
|
prerelease: false
|
|
59
|
+
type: :development
|
|
45
60
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
61
|
requirements:
|
|
47
|
-
- -
|
|
62
|
+
- - "~>"
|
|
48
63
|
- !ruby/object:Gem::Version
|
|
49
|
-
version:
|
|
64
|
+
version: 3.4.0
|
|
65
|
+
- !ruby/object:Gem::Dependency
|
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
|
67
|
+
requirements:
|
|
68
|
+
- - "~>"
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: '1.11'
|
|
71
|
+
name: bundler
|
|
72
|
+
prerelease: false
|
|
73
|
+
type: :development
|
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
75
|
+
requirements:
|
|
76
|
+
- - "~>"
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: '1.11'
|
|
79
|
+
- !ruby/object:Gem::Dependency
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - "~>"
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: '12.0'
|
|
85
|
+
name: rake
|
|
86
|
+
prerelease: false
|
|
87
|
+
type: :development
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
+
requirements:
|
|
90
|
+
- - "~>"
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
version: '12.0'
|
|
93
|
+
- !ruby/object:Gem::Dependency
|
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
|
95
|
+
requirements:
|
|
96
|
+
- - "~>"
|
|
97
|
+
- !ruby/object:Gem::Version
|
|
98
|
+
version: '5.10'
|
|
99
|
+
name: minitest
|
|
100
|
+
prerelease: false
|
|
101
|
+
type: :development
|
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
- - "~>"
|
|
105
|
+
- !ruby/object:Gem::Version
|
|
106
|
+
version: '5.10'
|
|
50
107
|
- !ruby/object:Gem::Dependency
|
|
51
|
-
name: mocha
|
|
52
108
|
requirement: !ruby/object:Gem::Requirement
|
|
53
109
|
requirements:
|
|
54
|
-
- -
|
|
110
|
+
- - "~>"
|
|
55
111
|
- !ruby/object:Gem::Version
|
|
56
|
-
version:
|
|
112
|
+
version: 0.46.0
|
|
113
|
+
name: rubocop
|
|
114
|
+
prerelease: false
|
|
57
115
|
type: :development
|
|
116
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
117
|
+
requirements:
|
|
118
|
+
- - "~>"
|
|
119
|
+
- !ruby/object:Gem::Version
|
|
120
|
+
version: 0.46.0
|
|
121
|
+
- !ruby/object:Gem::Dependency
|
|
122
|
+
requirement: !ruby/object:Gem::Requirement
|
|
123
|
+
requirements:
|
|
124
|
+
- - ">="
|
|
125
|
+
- !ruby/object:Gem::Version
|
|
126
|
+
version: 1.2.1
|
|
127
|
+
name: mocha
|
|
58
128
|
prerelease: false
|
|
129
|
+
type: :development
|
|
59
130
|
version_requirements: !ruby/object:Gem::Requirement
|
|
60
131
|
requirements:
|
|
61
|
-
- -
|
|
132
|
+
- - ">="
|
|
62
133
|
- !ruby/object:Gem::Version
|
|
63
|
-
version:
|
|
134
|
+
version: 1.2.1
|
|
64
135
|
description: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It
|
|
65
136
|
allows you to write programs that invoke and interact with processes on remote servers,
|
|
66
137
|
via SSH2.'
|
|
67
|
-
email:
|
|
138
|
+
email:
|
|
139
|
+
- net-ssh@solutious.com
|
|
68
140
|
executables: []
|
|
69
141
|
extensions: []
|
|
70
142
|
extra_rdoc_files:
|
|
71
143
|
- LICENSE.txt
|
|
72
144
|
- README.rdoc
|
|
73
145
|
files:
|
|
74
|
-
- .
|
|
146
|
+
- ".gitignore"
|
|
147
|
+
- ".rubocop.yml"
|
|
148
|
+
- ".rubocop_todo.yml"
|
|
149
|
+
- ".travis.yml"
|
|
75
150
|
- CHANGES.txt
|
|
151
|
+
- Gemfile
|
|
152
|
+
- Gemfile.norbnacl
|
|
153
|
+
- Gemfile.norbnacl.lock
|
|
154
|
+
- ISSUE_TEMPLATE.md
|
|
76
155
|
- LICENSE.txt
|
|
77
156
|
- Manifest
|
|
78
157
|
- README.rdoc
|
|
79
158
|
- Rakefile
|
|
80
|
-
- Rudyfile
|
|
81
159
|
- THANKS.txt
|
|
160
|
+
- appveyor.yml
|
|
82
161
|
- lib/net/ssh.rb
|
|
83
162
|
- lib/net/ssh/authentication/agent.rb
|
|
84
|
-
- lib/net/ssh/authentication/agent/java_pageant.rb
|
|
85
|
-
- lib/net/ssh/authentication/agent/socket.rb
|
|
86
163
|
- lib/net/ssh/authentication/constants.rb
|
|
164
|
+
- lib/net/ssh/authentication/ed25519.rb
|
|
165
|
+
- lib/net/ssh/authentication/ed25519_loader.rb
|
|
87
166
|
- lib/net/ssh/authentication/key_manager.rb
|
|
88
167
|
- lib/net/ssh/authentication/methods/abstract.rb
|
|
89
168
|
- lib/net/ssh/authentication/methods/hostbased.rb
|
|
@@ -98,6 +177,7 @@ files:
|
|
|
98
177
|
- lib/net/ssh/config.rb
|
|
99
178
|
- lib/net/ssh/connection/channel.rb
|
|
100
179
|
- lib/net/ssh/connection/constants.rb
|
|
180
|
+
- lib/net/ssh/connection/event_loop.rb
|
|
101
181
|
- lib/net/ssh/connection/keepalive.rb
|
|
102
182
|
- lib/net/ssh/connection/session.rb
|
|
103
183
|
- lib/net/ssh/connection/term.rb
|
|
@@ -110,6 +190,7 @@ files:
|
|
|
110
190
|
- lib/net/ssh/proxy/command.rb
|
|
111
191
|
- lib/net/ssh/proxy/errors.rb
|
|
112
192
|
- lib/net/ssh/proxy/http.rb
|
|
193
|
+
- lib/net/ssh/proxy/https.rb
|
|
113
194
|
- lib/net/ssh/proxy/socks4.rb
|
|
114
195
|
- lib/net/ssh/proxy/socks5.rb
|
|
115
196
|
- lib/net/ssh/ruby_compat.rb
|
|
@@ -161,95 +242,30 @@ files:
|
|
|
161
242
|
- lib/net/ssh/version.rb
|
|
162
243
|
- net-ssh-public_cert.pem
|
|
163
244
|
- net-ssh.gemspec
|
|
164
|
-
- setup.rb
|
|
165
245
|
- support/arcfour_check.rb
|
|
166
246
|
- support/ssh_tunnel_bug.rb
|
|
167
|
-
- test/README.txt
|
|
168
|
-
- test/authentication/methods/common.rb
|
|
169
|
-
- test/authentication/methods/test_abstract.rb
|
|
170
|
-
- test/authentication/methods/test_hostbased.rb
|
|
171
|
-
- test/authentication/methods/test_keyboard_interactive.rb
|
|
172
|
-
- test/authentication/methods/test_none.rb
|
|
173
|
-
- test/authentication/methods/test_password.rb
|
|
174
|
-
- test/authentication/methods/test_publickey.rb
|
|
175
|
-
- test/authentication/test_agent.rb
|
|
176
|
-
- test/authentication/test_key_manager.rb
|
|
177
|
-
- test/authentication/test_session.rb
|
|
178
|
-
- test/common.rb
|
|
179
|
-
- test/configs/auth_off
|
|
180
|
-
- test/configs/auth_on
|
|
181
|
-
- test/configs/empty
|
|
182
|
-
- test/configs/eqsign
|
|
183
|
-
- test/configs/exact_match
|
|
184
|
-
- test/configs/host_plus
|
|
185
|
-
- test/configs/multihost
|
|
186
|
-
- test/configs/negative_match
|
|
187
|
-
- test/configs/nohost
|
|
188
|
-
- test/configs/numeric_host
|
|
189
|
-
- test/configs/send_env
|
|
190
|
-
- test/configs/substitutes
|
|
191
|
-
- test/configs/wild_cards
|
|
192
|
-
- test/connection/test_channel.rb
|
|
193
|
-
- test/connection/test_session.rb
|
|
194
|
-
- test/known_hosts/github
|
|
195
|
-
- test/manual/test_forward.rb
|
|
196
|
-
- test/manual/test_pageant.rb
|
|
197
|
-
- test/start/test_connection.rb
|
|
198
|
-
- test/start/test_options.rb
|
|
199
|
-
- test/start/test_transport.rb
|
|
200
|
-
- test/test_all.rb
|
|
201
|
-
- test/test_buffer.rb
|
|
202
|
-
- test/test_buffered_io.rb
|
|
203
|
-
- test/test_config.rb
|
|
204
|
-
- test/test_key_factory.rb
|
|
205
|
-
- test/test_known_hosts.rb
|
|
206
|
-
- test/transport/hmac/test_md5.rb
|
|
207
|
-
- test/transport/hmac/test_md5_96.rb
|
|
208
|
-
- test/transport/hmac/test_none.rb
|
|
209
|
-
- test/transport/hmac/test_ripemd160.rb
|
|
210
|
-
- test/transport/hmac/test_sha1.rb
|
|
211
|
-
- test/transport/hmac/test_sha1_96.rb
|
|
212
|
-
- test/transport/hmac/test_sha2_256.rb
|
|
213
|
-
- test/transport/hmac/test_sha2_256_96.rb
|
|
214
|
-
- test/transport/hmac/test_sha2_512.rb
|
|
215
|
-
- test/transport/hmac/test_sha2_512_96.rb
|
|
216
|
-
- test/transport/kex/test_diffie_hellman_group14_sha1.rb
|
|
217
|
-
- test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
|
218
|
-
- test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
|
219
|
-
- test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
|
|
220
|
-
- test/transport/kex/test_ecdh_sha2_nistp256.rb
|
|
221
|
-
- test/transport/kex/test_ecdh_sha2_nistp384.rb
|
|
222
|
-
- test/transport/kex/test_ecdh_sha2_nistp521.rb
|
|
223
|
-
- test/transport/test_algorithms.rb
|
|
224
|
-
- test/transport/test_cipher_factory.rb
|
|
225
|
-
- test/transport/test_hmac.rb
|
|
226
|
-
- test/transport/test_identity_cipher.rb
|
|
227
|
-
- test/transport/test_packet_stream.rb
|
|
228
|
-
- test/transport/test_server_version.rb
|
|
229
|
-
- test/transport/test_session.rb
|
|
230
|
-
- test/transport/test_state.rb
|
|
231
247
|
homepage: https://github.com/net-ssh/net-ssh
|
|
232
248
|
licenses:
|
|
233
249
|
- MIT
|
|
234
250
|
metadata: {}
|
|
235
|
-
post_install_message:
|
|
251
|
+
post_install_message:
|
|
236
252
|
rdoc_options: []
|
|
237
253
|
require_paths:
|
|
238
254
|
- lib
|
|
239
255
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
256
|
requirements:
|
|
241
|
-
- -
|
|
257
|
+
- - ">="
|
|
242
258
|
- !ruby/object:Gem::Version
|
|
243
|
-
version: '0'
|
|
259
|
+
version: '2.0'
|
|
244
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
261
|
requirements:
|
|
246
|
-
- -
|
|
262
|
+
- - ">="
|
|
247
263
|
- !ruby/object:Gem::Version
|
|
248
264
|
version: '0'
|
|
249
265
|
requirements: []
|
|
250
|
-
rubyforge_project:
|
|
251
|
-
rubygems_version: 2.
|
|
252
|
-
signing_key:
|
|
266
|
+
rubyforge_project:
|
|
267
|
+
rubygems_version: 2.6.8
|
|
268
|
+
signing_key:
|
|
253
269
|
specification_version: 4
|
|
254
270
|
summary: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'
|
|
255
271
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/Rudyfile
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# Rudyfile
|
|
2
|
-
#
|
|
3
|
-
# This configuration is used to test installing
|
|
4
|
-
# and running net-ssh on a clean machine.
|
|
5
|
-
#
|
|
6
|
-
# Usage:
|
|
7
|
-
#
|
|
8
|
-
# $ rudy -vv startup
|
|
9
|
-
# $ rudy -vv testsuite
|
|
10
|
-
# $ rudy -vv shutdown
|
|
11
|
-
#
|
|
12
|
-
# Requires: Rudy 0.9 (http://code.google.com/p/rudy/)
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
defaults do
|
|
16
|
-
color true
|
|
17
|
-
environment :test
|
|
18
|
-
role :netssh
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
machines do
|
|
22
|
-
region :'us-east-1' do
|
|
23
|
-
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
|
24
|
-
end
|
|
25
|
-
env :test do
|
|
26
|
-
role :netssh do
|
|
27
|
-
user :root
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
commands do
|
|
33
|
-
allow :apt_get, "apt-get", :y, :q
|
|
34
|
-
allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
|
|
35
|
-
allow :gem_sources, "/usr/bin/gem", "sources"
|
|
36
|
-
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
|
37
|
-
allow :update_rubygems
|
|
38
|
-
allow :rm
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
routines do
|
|
42
|
-
|
|
43
|
-
testsuite do
|
|
44
|
-
before :sysupdate, :installdeps, :install_gem
|
|
45
|
-
|
|
46
|
-
remote :root do
|
|
47
|
-
directory_upload 'test', '/tmp/'
|
|
48
|
-
cd '/tmp'
|
|
49
|
-
ruby :I, 'lib/', :I, 'test/', :r, 'rubygems', 'test/test_all.rb'
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
after :install_rubyforge, :install_github
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
install_gem do
|
|
56
|
-
before :package_gem
|
|
57
|
-
remote :root do
|
|
58
|
-
disable_safe_mode
|
|
59
|
-
file_upload "pkg/net-ssh-*.gem", "/tmp/"
|
|
60
|
-
gem_install "/tmp/net-ssh-*.gem"
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
package_gem do
|
|
65
|
-
local do
|
|
66
|
-
rm :r, :f, 'pkg'
|
|
67
|
-
rake 'package'
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
remove do
|
|
72
|
-
remote :root do
|
|
73
|
-
gem_uninstall 'net-ssh'
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
installdeps do
|
|
78
|
-
remote :root do
|
|
79
|
-
gem_install "rye", "test-unit", "mocha"
|
|
80
|
-
rye 'authorize-local'
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
sysupdate do
|
|
85
|
-
remote :root do
|
|
86
|
-
apt_get "update"
|
|
87
|
-
apt_get "install", "build-essential", "git-core"
|
|
88
|
-
apt_get "install", "ruby1.8-dev", "rdoc", "libzlib-ruby", "rubygems"
|
|
89
|
-
mkdir :p, "/var/lib/gems/1.8/bin" # Doesn't get created, but causes Rubygems to fail
|
|
90
|
-
gem_install "builder", "session"
|
|
91
|
-
gem_install 'rubygems-update', "-v=1.3.4" # circular issue with 1.3.5 and hoe
|
|
92
|
-
update_rubygems
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
require 'jruby_pageant'
|
|
2
|
-
|
|
3
|
-
module Net; module SSH; module Authentication
|
|
4
|
-
|
|
5
|
-
# This class implements an agent for JRuby + Pageant.
|
|
6
|
-
#
|
|
7
|
-
# Written by Artūras Šlajus <arturas.slajus@gmail.com>
|
|
8
|
-
class Agent
|
|
9
|
-
include Loggable
|
|
10
|
-
include JRubyPageant
|
|
11
|
-
|
|
12
|
-
# A simple module for extending keys, to allow blobs and comments to be
|
|
13
|
-
# specified for them.
|
|
14
|
-
module Key
|
|
15
|
-
# :blob is used by OpenSSL::PKey::RSA#to_blob
|
|
16
|
-
attr_accessor :java_blob
|
|
17
|
-
attr_accessor :comment
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Instantiates a new agent object, connects to a running SSH agent,
|
|
21
|
-
# negotiates the agent protocol version, and returns the agent object.
|
|
22
|
-
def self.connect(logger=nil)
|
|
23
|
-
agent = new(logger)
|
|
24
|
-
agent.connect!
|
|
25
|
-
agent
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Creates a new Agent object, using the optional logger instance to
|
|
29
|
-
# report status.
|
|
30
|
-
def initialize(logger=nil)
|
|
31
|
-
self.logger = logger
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Connect to the agent process using the socket factory and socket name
|
|
35
|
-
# given by the attribute writers. If the agent on the other end of the
|
|
36
|
-
# socket reports that it is an SSH2-compatible agent, this will fail
|
|
37
|
-
# (it only supports the ssh-agent distributed by OpenSSH).
|
|
38
|
-
def connect!
|
|
39
|
-
debug { "connecting to Pageant ssh-agent (via java connector)" }
|
|
40
|
-
@agent_proxy = JRubyPageant.create
|
|
41
|
-
unless @agent_proxy.is_running
|
|
42
|
-
raise AgentNotAvailable, "Pageant is not running!"
|
|
43
|
-
end
|
|
44
|
-
debug { "connection to Pageant ssh-agent (via java connector) succeeded" }
|
|
45
|
-
rescue AgentProxyException => e
|
|
46
|
-
error { "could not connect to Pageant ssh-agent (via java connector)" }
|
|
47
|
-
raise AgentNotAvailable, e.message, e.backtrace
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Return an array of all identities (public keys) known to the agent.
|
|
51
|
-
# Each key returned is augmented with a +comment+ property which is set
|
|
52
|
-
# to the comment returned by the agent for that key.
|
|
53
|
-
def identities
|
|
54
|
-
debug { "getting identities from Pageant" }
|
|
55
|
-
@agent_proxy.get_identities.map do |identity|
|
|
56
|
-
blob = identity.get_blob
|
|
57
|
-
key = Buffer.new(String.from_java_bytes(blob)).read_key
|
|
58
|
-
key.extend(Key)
|
|
59
|
-
key.java_blob = blob
|
|
60
|
-
key.comment = String.from_java_bytes(identity.get_comment)
|
|
61
|
-
key
|
|
62
|
-
end
|
|
63
|
-
rescue AgentProxyException => e
|
|
64
|
-
raise AgentError, "Cannot get identities: #{e.message}", e.backtrace
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Simulate agent close. This agent reference is no longer able to
|
|
68
|
-
# query the agent.
|
|
69
|
-
def close
|
|
70
|
-
@agent_proxy = nil
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
# Using the agent and the given public key, sign the given data. The
|
|
74
|
-
# signature is returned in SSH2 format.
|
|
75
|
-
def sign(key, data)
|
|
76
|
-
signed = @agent_proxy.sign(key.java_blob, data.to_java_bytes)
|
|
77
|
-
String.from_java_bytes(signed)
|
|
78
|
-
rescue AgentProxyException => e
|
|
79
|
-
raise AgentError,
|
|
80
|
-
"agent could not sign data with requested identity: #{e.message}",
|
|
81
|
-
e.backtrace
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
end; end; end
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
require 'net/ssh/transport/server_version'
|
|
2
|
-
|
|
3
|
-
# Only load pageant on Windows
|
|
4
|
-
if Net::SSH::Authentication::PLATFORM == :win32
|
|
5
|
-
require 'net/ssh/authentication/pageant'
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
module Net; module SSH; module Authentication
|
|
9
|
-
|
|
10
|
-
# This class implements a simple client for the ssh-agent protocol. It
|
|
11
|
-
# does not implement any specific protocol, but instead copies the
|
|
12
|
-
# behavior of the ssh-agent functions in the OpenSSH library (3.8).
|
|
13
|
-
#
|
|
14
|
-
# This means that although it behaves like a SSH1 client, it also has
|
|
15
|
-
# some SSH2 functionality (like signing data).
|
|
16
|
-
class Agent
|
|
17
|
-
include Loggable
|
|
18
|
-
|
|
19
|
-
# A simple module for extending keys, to allow comments to be specified
|
|
20
|
-
# for them.
|
|
21
|
-
module Comment
|
|
22
|
-
attr_accessor :comment
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
SSH2_AGENT_REQUEST_VERSION = 1
|
|
26
|
-
SSH2_AGENT_REQUEST_IDENTITIES = 11
|
|
27
|
-
SSH2_AGENT_IDENTITIES_ANSWER = 12
|
|
28
|
-
SSH2_AGENT_SIGN_REQUEST = 13
|
|
29
|
-
SSH2_AGENT_SIGN_RESPONSE = 14
|
|
30
|
-
SSH2_AGENT_FAILURE = 30
|
|
31
|
-
SSH2_AGENT_VERSION_RESPONSE = 103
|
|
32
|
-
|
|
33
|
-
SSH_COM_AGENT2_FAILURE = 102
|
|
34
|
-
|
|
35
|
-
SSH_AGENT_REQUEST_RSA_IDENTITIES = 1
|
|
36
|
-
SSH_AGENT_RSA_IDENTITIES_ANSWER1 = 2
|
|
37
|
-
SSH_AGENT_RSA_IDENTITIES_ANSWER2 = 5
|
|
38
|
-
SSH_AGENT_FAILURE = 5
|
|
39
|
-
|
|
40
|
-
# The underlying socket being used to communicate with the SSH agent.
|
|
41
|
-
attr_reader :socket
|
|
42
|
-
|
|
43
|
-
# Instantiates a new agent object, connects to a running SSH agent,
|
|
44
|
-
# negotiates the agent protocol version, and returns the agent object.
|
|
45
|
-
def self.connect(logger=nil)
|
|
46
|
-
agent = new(logger)
|
|
47
|
-
agent.connect!
|
|
48
|
-
agent.negotiate!
|
|
49
|
-
agent
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# Creates a new Agent object, using the optional logger instance to
|
|
53
|
-
# report status.
|
|
54
|
-
def initialize(logger=nil)
|
|
55
|
-
self.logger = logger
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# Connect to the agent process using the socket factory and socket name
|
|
59
|
-
# given by the attribute writers. If the agent on the other end of the
|
|
60
|
-
# socket reports that it is an SSH2-compatible agent, this will fail
|
|
61
|
-
# (it only supports the ssh-agent distributed by OpenSSH).
|
|
62
|
-
def connect!
|
|
63
|
-
begin
|
|
64
|
-
debug { "connecting to ssh-agent" }
|
|
65
|
-
@socket = agent_socket_factory.open(ENV['SSH_AUTH_SOCK'])
|
|
66
|
-
rescue
|
|
67
|
-
error { "could not connect to ssh-agent" }
|
|
68
|
-
raise AgentNotAvailable, $!.message
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# Attempts to negotiate the SSH agent protocol version. Raises an error
|
|
73
|
-
# if the version could not be negotiated successfully.
|
|
74
|
-
def negotiate!
|
|
75
|
-
# determine what type of agent we're communicating with
|
|
76
|
-
type, body = send_and_wait(SSH2_AGENT_REQUEST_VERSION, :string, Transport::ServerVersion::PROTO_VERSION)
|
|
77
|
-
|
|
78
|
-
if type == SSH2_AGENT_VERSION_RESPONSE
|
|
79
|
-
raise AgentNotAvailable, "SSH2 agents are not yet supported"
|
|
80
|
-
elsif type == SSH2_AGENT_FAILURE
|
|
81
|
-
debug { "Unexpected response type==#{type}, this will be ignored" }
|
|
82
|
-
elsif type != SSH_AGENT_RSA_IDENTITIES_ANSWER1 && type != SSH_AGENT_RSA_IDENTITIES_ANSWER2
|
|
83
|
-
raise AgentNotAvailable, "unknown response from agent: #{type}, #{body.to_s.inspect}"
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
# Return an array of all identities (public keys) known to the agent.
|
|
88
|
-
# Each key returned is augmented with a +comment+ property which is set
|
|
89
|
-
# to the comment returned by the agent for that key.
|
|
90
|
-
def identities
|
|
91
|
-
type, body = send_and_wait(SSH2_AGENT_REQUEST_IDENTITIES)
|
|
92
|
-
raise AgentError, "could not get identity count" if agent_failed(type)
|
|
93
|
-
raise AgentError, "bad authentication reply: #{type}" if type != SSH2_AGENT_IDENTITIES_ANSWER
|
|
94
|
-
|
|
95
|
-
identities = []
|
|
96
|
-
body.read_long.times do
|
|
97
|
-
key_str = body.read_string
|
|
98
|
-
comment_str = body.read_string
|
|
99
|
-
begin
|
|
100
|
-
key = Buffer.new(key_str).read_key
|
|
101
|
-
key.extend(Comment)
|
|
102
|
-
key.comment = comment_str
|
|
103
|
-
identities.push key
|
|
104
|
-
rescue NotImplementedError => e
|
|
105
|
-
error { "ignoring unimplemented key:#{e.message} #{comment_str}" }
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
return identities
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
# Closes this socket. This agent reference is no longer able to
|
|
113
|
-
# query the agent.
|
|
114
|
-
def close
|
|
115
|
-
@socket.close
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# Using the agent and the given public key, sign the given data. The
|
|
119
|
-
# signature is returned in SSH2 format.
|
|
120
|
-
def sign(key, data)
|
|
121
|
-
type, reply = send_and_wait(SSH2_AGENT_SIGN_REQUEST, :string, Buffer.from(:key, key), :string, data, :long, 0)
|
|
122
|
-
|
|
123
|
-
if agent_failed(type)
|
|
124
|
-
raise AgentError, "agent could not sign data with requested identity"
|
|
125
|
-
elsif type != SSH2_AGENT_SIGN_RESPONSE
|
|
126
|
-
raise AgentError, "bad authentication response #{type}"
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
return reply.read_string
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
private
|
|
133
|
-
|
|
134
|
-
# Returns the agent socket factory to use.
|
|
135
|
-
def agent_socket_factory
|
|
136
|
-
if Net::SSH::Authentication::PLATFORM == :win32
|
|
137
|
-
Pageant::Socket
|
|
138
|
-
else
|
|
139
|
-
UNIXSocket
|
|
140
|
-
end
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# Send a new packet of the given type, with the associated data.
|
|
144
|
-
def send_packet(type, *args)
|
|
145
|
-
buffer = Buffer.from(*args)
|
|
146
|
-
data = [buffer.length + 1, type.to_i, buffer.to_s].pack("NCA*")
|
|
147
|
-
debug { "sending agent request #{type} len #{buffer.length}" }
|
|
148
|
-
@socket.send data, 0
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
# Read the next packet from the agent. This will return a two-part
|
|
152
|
-
# tuple consisting of the packet type, and the packet's body (which
|
|
153
|
-
# is returned as a Net::SSH::Buffer).
|
|
154
|
-
def read_packet
|
|
155
|
-
buffer = Net::SSH::Buffer.new(@socket.read(4))
|
|
156
|
-
buffer.append(@socket.read(buffer.read_long))
|
|
157
|
-
type = buffer.read_byte
|
|
158
|
-
debug { "received agent packet #{type} len #{buffer.length-4}" }
|
|
159
|
-
return type, buffer
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Send the given packet and return the subsequent reply from the agent.
|
|
163
|
-
# (See #send_packet and #read_packet).
|
|
164
|
-
def send_and_wait(type, *args)
|
|
165
|
-
send_packet(type, *args)
|
|
166
|
-
read_packet
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
# Returns +true+ if the parameter indicates a "failure" response from
|
|
170
|
-
# the agent, and +false+ otherwise.
|
|
171
|
-
def agent_failed(type)
|
|
172
|
-
type == SSH_AGENT_FAILURE ||
|
|
173
|
-
type == SSH2_AGENT_FAILURE ||
|
|
174
|
-
type == SSH_COM_AGENT2_FAILURE
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
end; end; end
|