forked from extern/SSH-Snake
Pick up optional SSH errors better.
This commit is contained in:
parent
f2522a1abe
commit
b5fa5be05c
4
Snake.nocomments.sh
Executable file → Normal file
4
Snake.nocomments.sh
Executable file → Normal file
@ -388,10 +388,10 @@ local ssh_extra_options
|
|||||||
local ssh_extra_option
|
local ssh_extra_option
|
||||||
ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1)
|
ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1)
|
||||||
for ssh_extra_option in "${ssh_extra_options[@]}"; do
|
for ssh_extra_option in "${ssh_extra_options[@]}"; do
|
||||||
[[ $(ssh "$ssh_extra_option" 2>&1) =~ Bad\ protocol\ 2\ host\ key\ algorithms|Bad\ SSH2\ KexAlgorithms|Bad\ key\ types ]] || ssh_options+=("$ssh_extra_option")
|
[[ "$(ssh "$ssh_extra_option" 2>&1)" =~ Bad\ protocol\ 2\ host\ key\ algorithms|Bad\ SSH2\ KexAlgorithms|Bad\ key\ types|diffie-hellman-group1-sha1|ssh-rsa ]] || ssh_options+=("$ssh_extra_option")
|
||||||
done
|
done
|
||||||
ssh_extra_options="-oPubkeyAcceptedKeyTypes=+ssh-rsa"
|
ssh_extra_options="-oPubkeyAcceptedKeyTypes=+ssh-rsa"
|
||||||
[[ $(ssh "$ssh_extra_option" 2>&1) =~ Bad\ configuration\ option|pubkeyacceptedkeytypes ]] || ssh_options+=("$ssh_extra_option")
|
[[ "$(ssh "$ssh_extra_option" 2>&1)" =~ Bad\ configuration\ option|pubkeyacceptedkeytypes ]] || ssh_options+=("$ssh_extra_option")
|
||||||
}
|
}
|
||||||
init_current_ips() {
|
init_current_ips() {
|
||||||
local current_ip
|
local current_ip
|
||||||
|
4
Snake.sh
4
Snake.sh
@ -662,10 +662,10 @@ check_ssh_options() {
|
|||||||
|
|
||||||
ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1)
|
ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1)
|
||||||
for ssh_extra_option in "${ssh_extra_options[@]}"; do
|
for ssh_extra_option in "${ssh_extra_options[@]}"; do
|
||||||
[[ $(ssh "$ssh_extra_option" 2>&1) =~ Bad\ protocol\ 2\ host\ key\ algorithms|Bad\ SSH2\ KexAlgorithms|Bad\ key\ types ]] || ssh_options+=("$ssh_extra_option")
|
[[ "$(ssh "$ssh_extra_option" 2>&1)" =~ Bad\ protocol\ 2\ host\ key\ algorithms|Bad\ SSH2\ KexAlgorithms|Bad\ key\ types|diffie-hellman-group1-sha1|ssh-rsa ]] || ssh_options+=("$ssh_extra_option")
|
||||||
done
|
done
|
||||||
ssh_extra_options="-oPubkeyAcceptedKeyTypes=+ssh-rsa"
|
ssh_extra_options="-oPubkeyAcceptedKeyTypes=+ssh-rsa"
|
||||||
[[ $(ssh "$ssh_extra_option" 2>&1) =~ Bad\ configuration\ option|pubkeyacceptedkeytypes ]] || ssh_options+=("$ssh_extra_option")
|
[[ "$(ssh "$ssh_extra_option" 2>&1)" =~ Bad\ configuration\ option|pubkeyacceptedkeytypes ]] || ssh_options+=("$ssh_extra_option")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determining the ip address of the current destination is difficult because it may have multiple ip addresses, and we are likely to connect to both of them eventually (including 127.0.0.1 for example).
|
# Determining the ip address of the current destination is difficult because it may have multiple ip addresses, and we are likely to connect to both of them eventually (including 127.0.0.1 for example).
|
||||||
|
Loading…
Reference in New Issue
Block a user