summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklós Fazekas <mfazekas@szemafor.com>2023-02-28 07:42:50 +0100
committerGitHub <noreply@github.com>2023-02-28 07:42:50 +0100
commitb472cde2778244c3e844c8f636f7a30dac5a447f (patch)
treec08a8aac57f1d8ec6fcbccbbdeebe80411a6ae5e
parentda52b108fded76af7bcf896340cd3e3862e74d66 (diff)
parentefbaadb5598217cd215ece30bd7243bea4128ef2 (diff)
downloadnet-ssh-b472cde2778244c3e844c8f636f7a30dac5a447f.tar.gz
Merge pull request #891 from RemcodM/master
Accept pubkey_algorithms option when starting a new connection
-rw-r--r--lib/net/ssh.rb7
-rw-r--r--test/start/test_options.rb7
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/net/ssh.rb b/lib/net/ssh.rb
index b72ab7f..7578d40 100644
--- a/lib/net/ssh.rb
+++ b/lib/net/ssh.rb
@@ -73,7 +73,7 @@ module Net
max_win_size send_env set_env use_agent number_of_password_prompts
append_all_supported_algorithms non_interactive password_prompt
agent_socket_factory minimum_dh_bits verify_host_key
- fingerprint_hash check_host_ip
+ fingerprint_hash check_host_ip pubkey_algorithms
]
# The standard means of starting a new SSH connection. When used with a
@@ -170,6 +170,11 @@ module Net
# * :properties => a hash of key/value pairs to add to the new connection's
# properties (see Net::SSH::Connection::Session#properties)
# * :proxy => a proxy instance (see Proxy) to use when connecting
+ # * :pubkey_algorithms => the public key authentication algorithms to use for
+ # this connection. Valid values are 'rsa-sha2-256-cert-v01@openssh.com',
+ # 'ssh-rsa-cert-v01@openssh.com', 'rsa-sha2-256', 'ssh-rsa'. Currently, this
+ # option is only used for RSA public key authentication and ignored for other
+ # types.
# * :rekey_blocks_limit => the max number of blocks to process before rekeying
# * :rekey_limit => the max number of bytes to process before rekeying
# * :rekey_packet_limit => the max number of packets to process before rekeying
diff --git a/test/start/test_options.rb b/test/start/test_options.rb
index 43a88a7..601f3d5 100644
--- a/test/start/test_options.rb
+++ b/test/start/test_options.rb
@@ -60,6 +60,13 @@ module NetSSH
end
end
+ def test_start_should_accept_pubkey_algorithms_option
+ assert_nothing_raised do
+ options = { pubkey_algorithms: %w[ssh-rsa] }
+ Net::SSH.start('localhost', 'testuser', options)
+ end
+ end
+
def test_start_should_accept_remote_user_option
assert_nothing_raised do
options = { remote_user: 'foo' }