diff --git a/Snake.nocomments.sh b/Snake.nocomments.sh old mode 100755 new mode 100644 index 0c68e3e..4c798c5 --- a/Snake.nocomments.sh +++ b/Snake.nocomments.sh @@ -388,10 +388,10 @@ local ssh_extra_options local ssh_extra_option ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1) 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 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() { local current_ip diff --git a/Snake.sh b/Snake.sh index f8c74fe..a875f04 100755 --- a/Snake.sh +++ b/Snake.sh @@ -662,10 +662,10 @@ check_ssh_options() { ssh_extra_options=(-oHostkeyAlgorithms=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1) 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 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).