net-ssh 3.2.0 → 7.2.0.rc1
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data/.dockerignore +6 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/config/rubocop_linter_action.yml +4 -0
- data/.github/workflows/ci-with-docker.yml +44 -0
- data/.github/workflows/ci.yml +93 -0
- data/.github/workflows/rubocop.yml +16 -0
- data/.gitignore +13 -0
- data/.rubocop.yml +22 -0
- data/.rubocop_todo.yml +1081 -0
- data/CHANGES.txt +237 -7
- data/DEVELOPMENT.md +23 -0
- data/Dockerfile +27 -0
- data/Dockerfile.openssl3 +17 -0
- data/Gemfile +13 -0
- data/Gemfile.noed25519 +12 -0
- data/Gemfile.norbnacl +12 -0
- data/ISSUE_TEMPLATE.md +30 -0
- data/Manifest +4 -5
- data/README.md +298 -0
- data/Rakefile +125 -74
- data/SECURITY.md +4 -0
- data/appveyor.yml +58 -0
- data/docker-compose.yml +23 -0
- data/lib/net/ssh/authentication/agent.rb +279 -18
- data/lib/net/ssh/authentication/certificate.rb +183 -0
- data/lib/net/ssh/authentication/constants.rb +17 -15
- data/lib/net/ssh/authentication/ed25519.rb +186 -0
- data/lib/net/ssh/authentication/ed25519_loader.rb +31 -0
- data/lib/net/ssh/authentication/key_manager.rb +86 -39
- data/lib/net/ssh/authentication/methods/abstract.rb +67 -48
- data/lib/net/ssh/authentication/methods/hostbased.rb +34 -37
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +13 -13
- data/lib/net/ssh/authentication/methods/none.rb +16 -19
- data/lib/net/ssh/authentication/methods/password.rb +27 -17
- data/lib/net/ssh/authentication/methods/publickey.rb +96 -55
- data/lib/net/ssh/authentication/pageant.rb +471 -367
- data/lib/net/ssh/authentication/pub_key_fingerprint.rb +43 -0
- data/lib/net/ssh/authentication/session.rb +131 -121
- data/lib/net/ssh/buffer.rb +399 -300
- data/lib/net/ssh/buffered_io.rb +154 -150
- data/lib/net/ssh/config.rb +308 -185
- data/lib/net/ssh/connection/channel.rb +635 -613
- data/lib/net/ssh/connection/constants.rb +29 -29
- data/lib/net/ssh/connection/event_loop.rb +123 -0
- data/lib/net/ssh/connection/keepalive.rb +55 -51
- data/lib/net/ssh/connection/session.rb +620 -551
- data/lib/net/ssh/connection/term.rb +125 -123
- data/lib/net/ssh/errors.rb +101 -99
- data/lib/net/ssh/key_factory.rb +197 -105
- data/lib/net/ssh/known_hosts.rb +214 -127
- data/lib/net/ssh/loggable.rb +50 -49
- data/lib/net/ssh/packet.rb +83 -79
- data/lib/net/ssh/prompt.rb +50 -81
- data/lib/net/ssh/proxy/command.rb +105 -90
- data/lib/net/ssh/proxy/errors.rb +12 -10
- data/lib/net/ssh/proxy/http.rb +82 -79
- data/lib/net/ssh/proxy/https.rb +50 -0
- data/lib/net/ssh/proxy/jump.rb +54 -0
- data/lib/net/ssh/proxy/socks4.rb +2 -6
- data/lib/net/ssh/proxy/socks5.rb +14 -17
- data/lib/net/ssh/service/forward.rb +370 -317
- data/lib/net/ssh/test/channel.rb +145 -136
- data/lib/net/ssh/test/extensions.rb +131 -110
- data/lib/net/ssh/test/kex.rb +34 -32
- data/lib/net/ssh/test/local_packet.rb +46 -44
- data/lib/net/ssh/test/packet.rb +89 -70
- data/lib/net/ssh/test/remote_packet.rb +32 -30
- data/lib/net/ssh/test/script.rb +156 -142
- data/lib/net/ssh/test/socket.rb +49 -48
- data/lib/net/ssh/test.rb +82 -77
- data/lib/net/ssh/transport/algorithms.rb +462 -359
- data/lib/net/ssh/transport/chacha20_poly1305_cipher.rb +117 -0
- data/lib/net/ssh/transport/chacha20_poly1305_cipher_loader.rb +17 -0
- data/lib/net/ssh/transport/cipher_factory.rb +122 -99
- data/lib/net/ssh/transport/constants.rb +32 -24
- data/lib/net/ssh/transport/ctr.rb +42 -22
- data/lib/net/ssh/transport/hmac/abstract.rb +81 -63
- data/lib/net/ssh/transport/hmac/md5.rb +0 -2
- data/lib/net/ssh/transport/hmac/md5_96.rb +0 -2
- data/lib/net/ssh/transport/hmac/none.rb +0 -2
- data/lib/net/ssh/transport/hmac/ripemd160.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1_96.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha2_256.rb +7 -11
- data/lib/net/ssh/transport/hmac/sha2_256_96.rb +4 -8
- data/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
- data/lib/net/ssh/transport/hmac/sha2_512.rb +6 -9
- data/lib/net/ssh/transport/hmac/sha2_512_96.rb +4 -8
- data/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
- data/lib/net/ssh/transport/hmac.rb +14 -12
- data/lib/net/ssh/transport/identity_cipher.rb +54 -44
- data/lib/net/ssh/transport/kex/abstract.rb +130 -0
- data/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
- data/lib/net/ssh/transport/kex/curve25519_sha256.rb +39 -0
- data/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +33 -40
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +119 -213
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +53 -61
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +5 -9
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +36 -90
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +18 -10
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +18 -10
- data/lib/net/ssh/transport/kex.rb +15 -12
- data/lib/net/ssh/transport/key_expander.rb +24 -20
- data/lib/net/ssh/transport/openssl.rb +161 -124
- data/lib/net/ssh/transport/openssl_cipher_extensions.rb +8 -0
- data/lib/net/ssh/transport/packet_stream.rb +246 -185
- data/lib/net/ssh/transport/server_version.rb +55 -56
- data/lib/net/ssh/transport/session.rb +306 -255
- data/lib/net/ssh/transport/state.rb +178 -176
- data/lib/net/ssh/verifiers/accept_new.rb +33 -0
- data/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +33 -0
- data/lib/net/ssh/verifiers/always.rb +58 -0
- data/lib/net/ssh/verifiers/never.rb +19 -0
- data/lib/net/ssh/version.rb +55 -53
- data/lib/net/ssh.rb +111 -47
- data/net-ssh-public_cert.pem +18 -18
- data/net-ssh.gemspec +38 -205
- data/support/ssh_tunnel_bug.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +173 -118
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -18
- data/README.rdoc +0 -182
- data/lib/net/ssh/authentication/agent/java_pageant.rb +0 -85
- data/lib/net/ssh/authentication/agent/socket.rb +0 -178
- data/lib/net/ssh/ruby_compat.rb +0 -46
- data/lib/net/ssh/verifiers/lenient.rb +0 -30
- data/lib/net/ssh/verifiers/null.rb +0 -12
- data/lib/net/ssh/verifiers/secure.rb +0 -52
- data/lib/net/ssh/verifiers/strict.rb +0 -24
- data/setup.rb +0 -1585
- data/support/arcfour_check.rb +0 -20
- data/test/README.txt +0 -18
- 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 -121
- 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 -232
- data/test/authentication/test_key_manager.rb +0 -240
- data/test/authentication/test_session.rb +0 -107
- data/test/common.rb +0 -125
- 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/proxy_remote_user +0 -2
- 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 -487
- data/test/connection/test_session.rb +0 -564
- data/test/integration/README.txt +0 -17
- data/test/integration/Vagrantfile +0 -12
- data/test/integration/common.rb +0 -63
- data/test/integration/playbook.yml +0 -56
- data/test/integration/test_forward.rb +0 -637
- data/test/integration/test_id_rsa_keys.rb +0 -96
- data/test/integration/test_proxy.rb +0 -93
- data/test/known_hosts/github +0 -1
- data/test/known_hosts/github_hash +0 -1
- data/test/manual/test_pageant.rb +0 -37
- data/test/start/test_connection.rb +0 -53
- data/test/start/test_options.rb +0 -57
- data/test/start/test_transport.rb +0 -28
- data/test/start/test_user_nil.rb +0 -27
- data/test/test_all.rb +0 -12
- data/test/test_buffer.rb +0 -433
- data/test/test_buffered_io.rb +0 -63
- data/test/test_config.rb +0 -268
- data/test/test_key_factory.rb +0 -191
- data/test/test_known_hosts.rb +0 -66
- 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 -150
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +0 -96
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +0 -19
- 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 -328
- 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 -1762
- data/test/transport/test_server_version.rb +0 -74
- data/test/transport/test_session.rb +0 -331
- data/test/transport/test_state.rb +0 -181
- data/test/verifiers/test_secure.rb +0 -40
data/lib/net/ssh.rb
CHANGED
|
@@ -4,6 +4,7 @@ ENV['HOME'] ||= ENV['HOMEPATH'] ? "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" : Dir.
|
|
|
4
4
|
|
|
5
5
|
require 'logger'
|
|
6
6
|
require 'etc'
|
|
7
|
+
require 'shellwords'
|
|
7
8
|
|
|
8
9
|
require 'net/ssh/config'
|
|
9
10
|
require 'net/ssh/errors'
|
|
@@ -11,9 +12,9 @@ require 'net/ssh/loggable'
|
|
|
11
12
|
require 'net/ssh/transport/session'
|
|
12
13
|
require 'net/ssh/authentication/session'
|
|
13
14
|
require 'net/ssh/connection/session'
|
|
15
|
+
require 'net/ssh/prompt'
|
|
14
16
|
|
|
15
17
|
module Net
|
|
16
|
-
|
|
17
18
|
# Net::SSH is a library for interacting, programmatically, with remote
|
|
18
19
|
# processes via the SSH2 protocol. Sessions are always initiated via
|
|
19
20
|
# Net::SSH.start. From there, a program interacts with the new SSH session
|
|
@@ -40,37 +41,39 @@ module Net
|
|
|
40
41
|
#
|
|
41
42
|
# == X == "execute a command and capture the output"
|
|
42
43
|
#
|
|
43
|
-
# Net::SSH.start("host", "user", :
|
|
44
|
+
# Net::SSH.start("host", "user", password: "password") do |ssh|
|
|
44
45
|
# result = ssh.exec!("ls -l")
|
|
45
46
|
# puts result
|
|
46
47
|
# end
|
|
47
48
|
#
|
|
48
49
|
# == X == "forward connections on a local port to a remote host"
|
|
49
50
|
#
|
|
50
|
-
# Net::SSH.start("host", "user", :
|
|
51
|
+
# Net::SSH.start("host", "user", password: "password") do |ssh|
|
|
51
52
|
# ssh.forward.local(1234, "www.google.com", 80)
|
|
52
53
|
# ssh.loop { true }
|
|
53
54
|
# end
|
|
54
55
|
#
|
|
55
56
|
# == X == "forward connections on a remote port to the local host"
|
|
56
57
|
#
|
|
57
|
-
# Net::SSH.start("host", "user", :
|
|
58
|
+
# Net::SSH.start("host", "user", password: "password") do |ssh|
|
|
58
59
|
# ssh.forward.remote(80, "www.google.com", 1234)
|
|
59
60
|
# ssh.loop { true }
|
|
60
61
|
# end
|
|
61
62
|
module SSH
|
|
62
63
|
# This is the set of options that Net::SSH.start recognizes. See
|
|
63
64
|
# Net::SSH.start for a description of each option.
|
|
64
|
-
VALID_OPTIONS = [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
VALID_OPTIONS = %i[
|
|
66
|
+
auth_methods bind_address compression compression_level config
|
|
67
|
+
encryption forward_agent hmac host_key identity_agent remote_user
|
|
68
|
+
keepalive keepalive_interval keepalive_maxcount kex keys key_data
|
|
69
|
+
keycerts languages logger paranoid password port proxy
|
|
70
|
+
rekey_blocks_limit rekey_limit rekey_packet_limit timeout verbose
|
|
71
|
+
known_hosts global_known_hosts_file user_known_hosts_file host_key_alias
|
|
72
|
+
host_name user properties passphrase keys_only max_pkt_size
|
|
73
|
+
max_win_size send_env set_env use_agent number_of_password_prompts
|
|
74
|
+
append_all_supported_algorithms non_interactive password_prompt
|
|
75
|
+
agent_socket_factory minimum_dh_bits verify_host_key
|
|
76
|
+
fingerprint_hash check_host_ip pubkey_algorithms
|
|
74
77
|
]
|
|
75
78
|
|
|
76
79
|
# The standard means of starting a new SSH connection. When used with a
|
|
@@ -105,6 +108,8 @@ module Net
|
|
|
105
108
|
# * :bind_address => the IP address on the connecting machine to use in
|
|
106
109
|
# establishing connection. (:bind_address is discarded if :proxy
|
|
107
110
|
# is set.)
|
|
111
|
+
# * :check_host_ip => Also ckeck IP address when connecting to remote host.
|
|
112
|
+
# Defaults to +true+.
|
|
108
113
|
# * :compression => the compression algorithm to use, or +true+ to use
|
|
109
114
|
# whatever is supported.
|
|
110
115
|
# * :compression_level => the compression level to use when sending data
|
|
@@ -116,7 +121,7 @@ module Net
|
|
|
116
121
|
# * :forward_agent => set to true if you want the SSH agent connection to
|
|
117
122
|
# be forwarded
|
|
118
123
|
# * :known_hosts => a custom object holding known hosts records.
|
|
119
|
-
# It must implement #search_for and add in a similiar manner as KnownHosts.
|
|
124
|
+
# It must implement #search_for and `add` in a similiar manner as KnownHosts.
|
|
120
125
|
# * :global_known_hosts_file => the location of the global known hosts
|
|
121
126
|
# file. Set to an array if you want to specify multiple global known
|
|
122
127
|
# hosts files. Defaults to %w(/etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2).
|
|
@@ -139,6 +144,8 @@ module Net
|
|
|
139
144
|
# * :kex => the key exchange algorithm (or algorithms) to use
|
|
140
145
|
# * :keys => an array of file names of private keys to use for publickey
|
|
141
146
|
# and hostbased authentication
|
|
147
|
+
# * :keycerts => an array of file names of key certificates to use
|
|
148
|
+
# with publickey authentication
|
|
142
149
|
# * :key_data => an array of strings, with each element of the array being
|
|
143
150
|
# a raw private key in PEM format.
|
|
144
151
|
# * :keys_only => set to +true+ to use only private keys from +keys+ and
|
|
@@ -151,12 +158,11 @@ module Net
|
|
|
151
158
|
# for better performance if your SSH server supports it (most do).
|
|
152
159
|
# * :max_win_size => maximum size we tell the other side that is supported for
|
|
153
160
|
# the window.
|
|
154
|
-
# * :
|
|
155
|
-
#
|
|
156
|
-
#
|
|
157
|
-
#
|
|
158
|
-
#
|
|
159
|
-
# returning false declines it and closes the connection.
|
|
161
|
+
# * :non_interactive => set to true if your app is non interactive and prefers
|
|
162
|
+
# authentication failure vs password prompt. Non-interactive applications
|
|
163
|
+
# should set it to true to prefer failing a password/etc auth methods vs.
|
|
164
|
+
# asking for password.
|
|
165
|
+
# * :paranoid => deprecated alias for :verify_host_key
|
|
160
166
|
# * :passphrase => the passphrase to use when loading a private key (default
|
|
161
167
|
# is +nil+, for no passphrase)
|
|
162
168
|
# * :password => the password to use to login
|
|
@@ -164,11 +170,18 @@ module Net
|
|
|
164
170
|
# * :properties => a hash of key/value pairs to add to the new connection's
|
|
165
171
|
# properties (see Net::SSH::Connection::Session#properties)
|
|
166
172
|
# * :proxy => a proxy instance (see Proxy) to use when connecting
|
|
173
|
+
# * :pubkey_algorithms => the public key authentication algorithms to use for
|
|
174
|
+
# this connection. Valid values are 'rsa-sha2-256-cert-v01@openssh.com',
|
|
175
|
+
# 'ssh-rsa-cert-v01@openssh.com', 'rsa-sha2-256', 'ssh-rsa'. Currently, this
|
|
176
|
+
# option is only used for RSA public key authentication and ignored for other
|
|
177
|
+
# types.
|
|
167
178
|
# * :rekey_blocks_limit => the max number of blocks to process before rekeying
|
|
168
179
|
# * :rekey_limit => the max number of bytes to process before rekeying
|
|
169
180
|
# * :rekey_packet_limit => the max number of packets to process before rekeying
|
|
170
181
|
# * :send_env => an array of local environment variable names to export to the
|
|
171
182
|
# remote environment. Names may be given as String or Regexp.
|
|
183
|
+
# * :set_env => a hash of environment variable names and values to set to the
|
|
184
|
+
# remote environment. Override the ones if specified in +send_env+.
|
|
172
185
|
# * :timeout => how long to wait for the initial connection to be made
|
|
173
186
|
# * :user => the user name to log in as; this overrides the +user+
|
|
174
187
|
# parameter, and is primarily only useful when provided via an SSH
|
|
@@ -177,10 +190,9 @@ module Net
|
|
|
177
190
|
# * :user_known_hosts_file => the location of the user known hosts file.
|
|
178
191
|
# Set to an array to specify multiple user known hosts files.
|
|
179
192
|
# Defaults to %w(~/.ssh/known_hosts ~/.ssh/known_hosts2).
|
|
180
|
-
# * :use_agent => Set false to disable the use of ssh-agent. Defaults to
|
|
193
|
+
# * :use_agent => Set false to disable the use of ssh-agent. Defaults to
|
|
181
194
|
# true
|
|
182
|
-
# * :
|
|
183
|
-
# authentication failure vs password prompt
|
|
195
|
+
# * :identity_agent => the path to the ssh-agent's UNIX socket
|
|
184
196
|
# * :verbose => how verbose to be (Logger verbosity constants, Logger::DEBUG
|
|
185
197
|
# is very verbose, Logger::FATAL is all but silent). Logger::FATAL is the
|
|
186
198
|
# default. The symbols :debug, :info, :warn, :error, and :fatal are also
|
|
@@ -190,49 +202,61 @@ module Net
|
|
|
190
202
|
# * :number_of_password_prompts => Number of prompts for the password
|
|
191
203
|
# authentication method defaults to 3 set to 0 to disable prompt for
|
|
192
204
|
# password auth method
|
|
193
|
-
# * :
|
|
194
|
-
#
|
|
205
|
+
# * :password_prompt => a custom prompt object with ask method. See Net::SSH::Prompt
|
|
206
|
+
#
|
|
195
207
|
# * :agent_socket_factory => enables the user to pass a lambda/block that will serve as the socket factory
|
|
196
|
-
# Net::SSH
|
|
208
|
+
# Net::SSH.start(host,user,agent_socket_factory: ->{ UNIXSocket.open('/foo/bar') })
|
|
197
209
|
# example: ->{ UNIXSocket.open('/foo/bar')}
|
|
198
|
-
#
|
|
210
|
+
# * :verify_host_key => specify how strict host-key verification should be.
|
|
211
|
+
# In order of increasing strictness:
|
|
212
|
+
# * :never (very insecure) ::Net::SSH::Verifiers::Never
|
|
213
|
+
# * :accept_new_or_local_tunnel (insecure) ::Net::SSH::Verifiers::AcceptNewOrLocalTunnel
|
|
214
|
+
# * :accept_new (insecure) ::Net::SSH::Verifiers::AcceptNew
|
|
215
|
+
# * :always (secure) ::Net::SSH::Verifiers::Always
|
|
216
|
+
# You can also provide an own Object which responds to +verify+. The argument
|
|
217
|
+
# given to +verify+ is a hash consisting of the +:key+, the +:key_blob+,
|
|
218
|
+
# the +:fingerprint+ and the +:session+. Returning true accepts the host key,
|
|
219
|
+
# returning false declines it and closes the connection.
|
|
220
|
+
# * :fingerprint_hash => 'MD5' or 'SHA256', defaults to 'SHA256'
|
|
199
221
|
# If +user+ parameter is nil it defaults to USER from ssh_config, or
|
|
200
222
|
# local username
|
|
201
|
-
def self.start(host, user=nil, options={}, &block)
|
|
223
|
+
def self.start(host, user = nil, options = {}, &block)
|
|
202
224
|
invalid_options = options.keys - VALID_OPTIONS
|
|
203
225
|
if invalid_options.any?
|
|
204
226
|
raise ArgumentError, "invalid option(s): #{invalid_options.join(', ')}"
|
|
205
227
|
end
|
|
206
228
|
|
|
229
|
+
assign_defaults(options)
|
|
230
|
+
_sanitize_options(options)
|
|
231
|
+
|
|
207
232
|
options[:user] = user if user
|
|
208
233
|
options = configuration_for(host, options.fetch(:config, true)).merge(options)
|
|
209
234
|
host = options.fetch(:host_name, host)
|
|
210
235
|
|
|
211
|
-
|
|
212
|
-
options[:logger] = Logger.new(STDERR)
|
|
213
|
-
options[:logger].level = Logger::FATAL
|
|
214
|
-
end
|
|
236
|
+
options[:check_host_ip] = true unless options.key?(:check_host_ip)
|
|
215
237
|
|
|
216
238
|
if options[:non_interactive]
|
|
217
239
|
options[:number_of_password_prompts] = 0
|
|
218
240
|
end
|
|
219
241
|
|
|
242
|
+
_support_deprecated_option_paranoid(options)
|
|
243
|
+
|
|
220
244
|
if options[:verbose]
|
|
221
245
|
options[:logger].level = case options[:verbose]
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
246
|
+
when Integer then options[:verbose]
|
|
247
|
+
when :debug then Logger::DEBUG
|
|
248
|
+
when :info then Logger::INFO
|
|
249
|
+
when :warn then Logger::WARN
|
|
250
|
+
when :error then Logger::ERROR
|
|
251
|
+
when :fatal then Logger::FATAL
|
|
252
|
+
else raise ArgumentError, "can't convert #{options[:verbose].inspect} to any of the Logger level constants"
|
|
253
|
+
end
|
|
230
254
|
end
|
|
231
255
|
|
|
232
256
|
transport = Transport::Session.new(host, options)
|
|
233
257
|
auth = Authentication::Session.new(transport, options)
|
|
234
258
|
|
|
235
|
-
user = options.fetch(:user, user) || Etc.
|
|
259
|
+
user = options.fetch(:user, user) || Etc.getpwuid.name
|
|
236
260
|
if auth.authenticate("ssh-connection", user, options[:password])
|
|
237
261
|
connection = Connection::Session.new(transport, options)
|
|
238
262
|
if block_given?
|
|
@@ -259,14 +283,54 @@ module Net
|
|
|
259
283
|
# to read.
|
|
260
284
|
#
|
|
261
285
|
# See Net::SSH::Config for the full description of all supported options.
|
|
262
|
-
def self.configuration_for(host, use_ssh_config
|
|
286
|
+
def self.configuration_for(host, use_ssh_config)
|
|
263
287
|
files = case use_ssh_config
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
288
|
+
when true then Net::SSH::Config.expandable_default_files
|
|
289
|
+
when false, nil then return {}
|
|
290
|
+
else Array(use_ssh_config)
|
|
291
|
+
end
|
|
268
292
|
|
|
269
293
|
Net::SSH::Config.for(host, files)
|
|
270
294
|
end
|
|
295
|
+
|
|
296
|
+
def self.assign_defaults(options)
|
|
297
|
+
if !options[:logger]
|
|
298
|
+
options[:logger] = Logger.new(STDERR)
|
|
299
|
+
options[:logger].level = Logger::FATAL
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
options[:password_prompt] ||= Prompt.default(options)
|
|
303
|
+
|
|
304
|
+
%i[password passphrase].each do |key|
|
|
305
|
+
options.delete(key) if options.key?(key) && options[key].nil?
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
def self._sanitize_options(options)
|
|
310
|
+
invalid_option_values = [nil, [nil]]
|
|
311
|
+
unless (options.values & invalid_option_values).empty?
|
|
312
|
+
nil_options = options.select { |_k, v| invalid_option_values.include?(v) }.map(&:first)
|
|
313
|
+
Kernel.warn "#{caller_locations(2, 1)[0]}: Passing nil, or [nil] to Net::SSH.start is deprecated for keys: #{nil_options.join(', ')}"
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
private_class_method :_sanitize_options
|
|
317
|
+
|
|
318
|
+
def self._support_deprecated_option_paranoid(options)
|
|
319
|
+
if options.key?(:paranoid)
|
|
320
|
+
Kernel.warn(
|
|
321
|
+
":paranoid is deprecated, please use :verify_host_key. Supported " \
|
|
322
|
+
"values are exactly the same, only the name of the option has changed."
|
|
323
|
+
)
|
|
324
|
+
if options.key?(:verify_host_key)
|
|
325
|
+
Kernel.warn(
|
|
326
|
+
"Both :paranoid and :verify_host_key were specified. " \
|
|
327
|
+
":verify_host_key takes precedence, :paranoid will be ignored."
|
|
328
|
+
)
|
|
329
|
+
else
|
|
330
|
+
options[:verify_host_key] = options.delete(:paranoid)
|
|
331
|
+
end
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
private_class_method :_support_deprecated_option_paranoid
|
|
271
335
|
end
|
|
272
336
|
end
|
data/net-ssh-public_cert.pem
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
|
3
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMzAxMjQwMzE3NTVaFw0yNDAxMjQw
|
|
4
|
+
MzE3NTVaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
|
5
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
|
|
6
|
+
wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
|
|
7
|
+
x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
|
|
8
|
+
lntgSDNW5+kCS8QaRsmIbzj17GKKkrsw39kiQw7FhWfJFeTjddzoZiWwc59KA/Bx
|
|
9
|
+
fBbmDnsMLAtAtauMOxORrbx3EOY7sHku/kSrMg3FXFay7jc6BkbbUij+MjJ/k82l
|
|
10
|
+
4o8o0YO4BAnya90xgEmgOG0LCCxRhuXQFnMDuDjK2XnUe0h4/6NCn94C+z9GsQID
|
|
11
|
+
AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
|
|
12
|
+
M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
|
|
13
|
+
HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
|
|
14
|
+
ggEBAHyOSaOUji+EJFWZ46g+2EZ/kG7EFloFtIQUz8jDJIWGE+3NV5po1M0Z6EqH
|
|
15
|
+
XmG3BtMLfgOV9NwMQRqIdKnZDfKsqM/FOu+9IqrP+OieAde5OrXR2pzQls60Xft7
|
|
16
|
+
3qNVaQS99woQRqiUiDQQ7WagOYrZjuVANqTDNt4myzGSjS5sHcKlz3PRn0LJRMe5
|
|
17
|
+
ouuLwQ7BCXityv5RRXex2ibCOyY7pB5ris6xDnPe1WdlyCfUf1Fb+Yqxpy6a8QmH
|
|
18
|
+
v84waVXQ2i5M7pJaHVBF7DxxeW/q8W3VCnsq8vmmvULSThD18QqYGaFDJeN8sTR4
|
|
19
|
+
6tfjgZ6OvGSScvbCMHkCE9XjonE=
|
|
20
20
|
-----END CERTIFICATE-----
|
data/net-ssh.gemspec
CHANGED
|
@@ -1,213 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
-
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: net-ssh 3.2.0 ruby lib
|
|
1
|
+
require_relative 'lib/net/ssh/version'
|
|
6
2
|
|
|
7
|
-
Gem::Specification.new do |
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Gem::Specification.new do |spec|
|
|
4
|
+
spec.name = "net-ssh"
|
|
5
|
+
spec.version = Net::SSH::Version::STRING
|
|
6
|
+
spec.authors = ["Jamis Buck", "Delano Mandelbaum", "Mikl\u{f3}s Fazekas"]
|
|
7
|
+
spec.email = ["net-ssh@solutious.com"]
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
if ENV['NET_SSH_BUILDGEM_SIGNED']
|
|
10
|
+
spec.cert_chain = ["net-ssh-public_cert.pem"]
|
|
11
|
+
spec.signing_key = "/mnt/gem/net-ssh-private_key.pem"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
spec.summary = %q{Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.}
|
|
15
|
+
spec.description = %q{Net::SSH: 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.}
|
|
16
|
+
spec.homepage = "https://github.com/net-ssh/net-ssh"
|
|
17
|
+
spec.license = "MIT"
|
|
18
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.6")
|
|
19
|
+
spec.metadata = {
|
|
20
|
+
"changelog_uri" => "https://github.com/net-ssh/net-ssh/blob/master/CHANGES.txt"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
spec.extra_rdoc_files = [
|
|
25
24
|
"LICENSE.txt",
|
|
26
|
-
"
|
|
27
|
-
"README.rdoc",
|
|
28
|
-
"Rakefile",
|
|
29
|
-
"THANKS.txt",
|
|
30
|
-
"lib/net/ssh.rb",
|
|
31
|
-
"lib/net/ssh/authentication/agent.rb",
|
|
32
|
-
"lib/net/ssh/authentication/agent/java_pageant.rb",
|
|
33
|
-
"lib/net/ssh/authentication/agent/socket.rb",
|
|
34
|
-
"lib/net/ssh/authentication/constants.rb",
|
|
35
|
-
"lib/net/ssh/authentication/key_manager.rb",
|
|
36
|
-
"lib/net/ssh/authentication/methods/abstract.rb",
|
|
37
|
-
"lib/net/ssh/authentication/methods/hostbased.rb",
|
|
38
|
-
"lib/net/ssh/authentication/methods/keyboard_interactive.rb",
|
|
39
|
-
"lib/net/ssh/authentication/methods/none.rb",
|
|
40
|
-
"lib/net/ssh/authentication/methods/password.rb",
|
|
41
|
-
"lib/net/ssh/authentication/methods/publickey.rb",
|
|
42
|
-
"lib/net/ssh/authentication/pageant.rb",
|
|
43
|
-
"lib/net/ssh/authentication/session.rb",
|
|
44
|
-
"lib/net/ssh/buffer.rb",
|
|
45
|
-
"lib/net/ssh/buffered_io.rb",
|
|
46
|
-
"lib/net/ssh/config.rb",
|
|
47
|
-
"lib/net/ssh/connection/channel.rb",
|
|
48
|
-
"lib/net/ssh/connection/constants.rb",
|
|
49
|
-
"lib/net/ssh/connection/keepalive.rb",
|
|
50
|
-
"lib/net/ssh/connection/session.rb",
|
|
51
|
-
"lib/net/ssh/connection/term.rb",
|
|
52
|
-
"lib/net/ssh/errors.rb",
|
|
53
|
-
"lib/net/ssh/key_factory.rb",
|
|
54
|
-
"lib/net/ssh/known_hosts.rb",
|
|
55
|
-
"lib/net/ssh/loggable.rb",
|
|
56
|
-
"lib/net/ssh/packet.rb",
|
|
57
|
-
"lib/net/ssh/prompt.rb",
|
|
58
|
-
"lib/net/ssh/proxy/command.rb",
|
|
59
|
-
"lib/net/ssh/proxy/errors.rb",
|
|
60
|
-
"lib/net/ssh/proxy/http.rb",
|
|
61
|
-
"lib/net/ssh/proxy/socks4.rb",
|
|
62
|
-
"lib/net/ssh/proxy/socks5.rb",
|
|
63
|
-
"lib/net/ssh/ruby_compat.rb",
|
|
64
|
-
"lib/net/ssh/service/forward.rb",
|
|
65
|
-
"lib/net/ssh/test.rb",
|
|
66
|
-
"lib/net/ssh/test/channel.rb",
|
|
67
|
-
"lib/net/ssh/test/extensions.rb",
|
|
68
|
-
"lib/net/ssh/test/kex.rb",
|
|
69
|
-
"lib/net/ssh/test/local_packet.rb",
|
|
70
|
-
"lib/net/ssh/test/packet.rb",
|
|
71
|
-
"lib/net/ssh/test/remote_packet.rb",
|
|
72
|
-
"lib/net/ssh/test/script.rb",
|
|
73
|
-
"lib/net/ssh/test/socket.rb",
|
|
74
|
-
"lib/net/ssh/transport/algorithms.rb",
|
|
75
|
-
"lib/net/ssh/transport/cipher_factory.rb",
|
|
76
|
-
"lib/net/ssh/transport/constants.rb",
|
|
77
|
-
"lib/net/ssh/transport/ctr.rb",
|
|
78
|
-
"lib/net/ssh/transport/hmac.rb",
|
|
79
|
-
"lib/net/ssh/transport/hmac/abstract.rb",
|
|
80
|
-
"lib/net/ssh/transport/hmac/md5.rb",
|
|
81
|
-
"lib/net/ssh/transport/hmac/md5_96.rb",
|
|
82
|
-
"lib/net/ssh/transport/hmac/none.rb",
|
|
83
|
-
"lib/net/ssh/transport/hmac/ripemd160.rb",
|
|
84
|
-
"lib/net/ssh/transport/hmac/sha1.rb",
|
|
85
|
-
"lib/net/ssh/transport/hmac/sha1_96.rb",
|
|
86
|
-
"lib/net/ssh/transport/hmac/sha2_256.rb",
|
|
87
|
-
"lib/net/ssh/transport/hmac/sha2_256_96.rb",
|
|
88
|
-
"lib/net/ssh/transport/hmac/sha2_512.rb",
|
|
89
|
-
"lib/net/ssh/transport/hmac/sha2_512_96.rb",
|
|
90
|
-
"lib/net/ssh/transport/identity_cipher.rb",
|
|
91
|
-
"lib/net/ssh/transport/kex.rb",
|
|
92
|
-
"lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb",
|
|
93
|
-
"lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb",
|
|
94
|
-
"lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb",
|
|
95
|
-
"lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb",
|
|
96
|
-
"lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb",
|
|
97
|
-
"lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb",
|
|
98
|
-
"lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb",
|
|
99
|
-
"lib/net/ssh/transport/key_expander.rb",
|
|
100
|
-
"lib/net/ssh/transport/openssl.rb",
|
|
101
|
-
"lib/net/ssh/transport/packet_stream.rb",
|
|
102
|
-
"lib/net/ssh/transport/server_version.rb",
|
|
103
|
-
"lib/net/ssh/transport/session.rb",
|
|
104
|
-
"lib/net/ssh/transport/state.rb",
|
|
105
|
-
"lib/net/ssh/verifiers/lenient.rb",
|
|
106
|
-
"lib/net/ssh/verifiers/null.rb",
|
|
107
|
-
"lib/net/ssh/verifiers/secure.rb",
|
|
108
|
-
"lib/net/ssh/verifiers/strict.rb",
|
|
109
|
-
"lib/net/ssh/version.rb",
|
|
110
|
-
"net-ssh-public_cert.pem",
|
|
111
|
-
"net-ssh.gemspec",
|
|
112
|
-
"setup.rb",
|
|
113
|
-
"support/arcfour_check.rb",
|
|
114
|
-
"support/ssh_tunnel_bug.rb",
|
|
115
|
-
"test/README.txt",
|
|
116
|
-
"test/authentication/methods/common.rb",
|
|
117
|
-
"test/authentication/methods/test_abstract.rb",
|
|
118
|
-
"test/authentication/methods/test_hostbased.rb",
|
|
119
|
-
"test/authentication/methods/test_keyboard_interactive.rb",
|
|
120
|
-
"test/authentication/methods/test_none.rb",
|
|
121
|
-
"test/authentication/methods/test_password.rb",
|
|
122
|
-
"test/authentication/methods/test_publickey.rb",
|
|
123
|
-
"test/authentication/test_agent.rb",
|
|
124
|
-
"test/authentication/test_key_manager.rb",
|
|
125
|
-
"test/authentication/test_session.rb",
|
|
126
|
-
"test/common.rb",
|
|
127
|
-
"test/configs/auth_off",
|
|
128
|
-
"test/configs/auth_on",
|
|
129
|
-
"test/configs/empty",
|
|
130
|
-
"test/configs/eqsign",
|
|
131
|
-
"test/configs/exact_match",
|
|
132
|
-
"test/configs/host_plus",
|
|
133
|
-
"test/configs/multihost",
|
|
134
|
-
"test/configs/negative_match",
|
|
135
|
-
"test/configs/nohost",
|
|
136
|
-
"test/configs/numeric_host",
|
|
137
|
-
"test/configs/proxy_remote_user",
|
|
138
|
-
"test/configs/send_env",
|
|
139
|
-
"test/configs/substitutes",
|
|
140
|
-
"test/configs/wild_cards",
|
|
141
|
-
"test/connection/test_channel.rb",
|
|
142
|
-
"test/connection/test_session.rb",
|
|
143
|
-
"test/integration/README.txt",
|
|
144
|
-
"test/integration/Vagrantfile",
|
|
145
|
-
"test/integration/common.rb",
|
|
146
|
-
"test/integration/playbook.yml",
|
|
147
|
-
"test/integration/test_forward.rb",
|
|
148
|
-
"test/integration/test_id_rsa_keys.rb",
|
|
149
|
-
"test/integration/test_proxy.rb",
|
|
150
|
-
"test/known_hosts/github",
|
|
151
|
-
"test/known_hosts/github_hash",
|
|
152
|
-
"test/manual/test_pageant.rb",
|
|
153
|
-
"test/start/test_connection.rb",
|
|
154
|
-
"test/start/test_options.rb",
|
|
155
|
-
"test/start/test_transport.rb",
|
|
156
|
-
"test/start/test_user_nil.rb",
|
|
157
|
-
"test/test_all.rb",
|
|
158
|
-
"test/test_buffer.rb",
|
|
159
|
-
"test/test_buffered_io.rb",
|
|
160
|
-
"test/test_config.rb",
|
|
161
|
-
"test/test_key_factory.rb",
|
|
162
|
-
"test/test_known_hosts.rb",
|
|
163
|
-
"test/transport/hmac/test_md5.rb",
|
|
164
|
-
"test/transport/hmac/test_md5_96.rb",
|
|
165
|
-
"test/transport/hmac/test_none.rb",
|
|
166
|
-
"test/transport/hmac/test_ripemd160.rb",
|
|
167
|
-
"test/transport/hmac/test_sha1.rb",
|
|
168
|
-
"test/transport/hmac/test_sha1_96.rb",
|
|
169
|
-
"test/transport/hmac/test_sha2_256.rb",
|
|
170
|
-
"test/transport/hmac/test_sha2_256_96.rb",
|
|
171
|
-
"test/transport/hmac/test_sha2_512.rb",
|
|
172
|
-
"test/transport/hmac/test_sha2_512_96.rb",
|
|
173
|
-
"test/transport/kex/test_diffie_hellman_group14_sha1.rb",
|
|
174
|
-
"test/transport/kex/test_diffie_hellman_group1_sha1.rb",
|
|
175
|
-
"test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb",
|
|
176
|
-
"test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb",
|
|
177
|
-
"test/transport/kex/test_ecdh_sha2_nistp256.rb",
|
|
178
|
-
"test/transport/kex/test_ecdh_sha2_nistp384.rb",
|
|
179
|
-
"test/transport/kex/test_ecdh_sha2_nistp521.rb",
|
|
180
|
-
"test/transport/test_algorithms.rb",
|
|
181
|
-
"test/transport/test_cipher_factory.rb",
|
|
182
|
-
"test/transport/test_hmac.rb",
|
|
183
|
-
"test/transport/test_identity_cipher.rb",
|
|
184
|
-
"test/transport/test_packet_stream.rb",
|
|
185
|
-
"test/transport/test_server_version.rb",
|
|
186
|
-
"test/transport/test_session.rb",
|
|
187
|
-
"test/transport/test_state.rb",
|
|
188
|
-
"test/verifiers/test_secure.rb"
|
|
25
|
+
"README.md"
|
|
189
26
|
]
|
|
190
|
-
s.homepage = "https://github.com/net-ssh/net-ssh"
|
|
191
|
-
s.licenses = ["MIT"]
|
|
192
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.0")
|
|
193
|
-
s.rubyforge_project = "net-ssh"
|
|
194
|
-
s.rubygems_version = "2.4.6"
|
|
195
|
-
s.signing_key = "/mnt/gem/net-ssh-private_key.pem"
|
|
196
|
-
s.summary = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol."
|
|
197
27
|
|
|
198
|
-
|
|
199
|
-
|
|
28
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
29
|
+
spec.bindir = "exe"
|
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
200
32
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
|
206
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
|
207
|
-
end
|
|
208
|
-
else
|
|
209
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
|
210
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
|
33
|
+
unless ENV['NET_SSH_NO_ED25519']
|
|
34
|
+
spec.add_development_dependency("bcrypt_pbkdf", "~> 1.0") unless RUBY_PLATFORM == "java"
|
|
35
|
+
spec.add_development_dependency("ed25519", "~> 1.2")
|
|
36
|
+
spec.add_development_dependency('x25519') unless RUBY_PLATFORM == 'java'
|
|
211
37
|
end
|
|
212
|
-
end
|
|
213
38
|
|
|
39
|
+
spec.add_development_dependency('rbnacl', '~> 7.1') unless ENV['NET_SSH_NO_RBNACL']
|
|
40
|
+
|
|
41
|
+
spec.add_development_dependency "bundler", ">= 1.17"
|
|
42
|
+
spec.add_development_dependency "minitest", "~> 5.10"
|
|
43
|
+
spec.add_development_dependency "mocha", "~> 1.11.2"
|
|
44
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
|
45
|
+
spec.add_development_dependency "rubocop", "~> 1.28.0"
|
|
46
|
+
end
|
data/support/ssh_tunnel_bug.rb
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
# visible_hostname netsshtest
|
|
16
16
|
# * Start squid squid -N -d 1 -D
|
|
17
17
|
# * Run this script
|
|
18
|
-
# * Configure browser proxy to use localhost with LOCAL_PORT.
|
|
18
|
+
# * Configure browser proxy to use localhost with LOCAL_PORT.
|
|
19
19
|
# * Load any page, wait for it to load fully. If the page loads
|
|
20
20
|
# correctly, move on. If not, something needs to be corrected.
|
|
21
21
|
# * Refresh the page several times. This should cause this
|
|
22
22
|
# script to failed with the error: "closed stream". You may
|
|
23
|
-
# need to try a few times.
|
|
23
|
+
# need to try a few times.
|
|
24
24
|
#
|
|
25
25
|
|
|
26
26
|
require 'highline/import'
|
|
@@ -37,10 +37,10 @@ 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
|
-
session.loop{true}
|
|
43
|
-
rescue => e
|
|
42
|
+
session.loop {true}
|
|
43
|
+
rescue StandardError => e
|
|
44
44
|
puts e.message
|
|
45
45
|
puts e.backtrace
|
|
46
46
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|