From 73583a770a4f00596e68db502c6deb0ba0f661cd Mon Sep 17 00:00:00 2001 From: LukeZGD <26163116+LukeZGD@users.noreply.github.com> Date: Mon, 8 Jan 2024 07:53:22 +0800 Subject: [PATCH] Check SSH version (fixes #377) --- resources/ssh_config | 1 - restore.sh | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/ssh_config b/resources/ssh_config index 3496bbad..3eb1d5a2 100644 --- a/resources/ssh_config +++ b/resources/ssh_config @@ -4,4 +4,3 @@ Host * StrictHostKeyChecking no UserKnownHostsFile /dev/null HostKeyAlgorithms +ssh-rsa - PubkeyAcceptedAlgorithms +ssh-rsa diff --git a/restore.sh b/restore.sh index 6889524d..b8c9d9fc 100755 --- a/restore.sh +++ b/restore.sh @@ -292,6 +292,12 @@ set_tool_paths() { idevicererestore+="$dir/idevicererestore" ipwnder+="$dir/ipwnder" irecovery2+="$dir/irecovery2" + + cp ../resources/ssh_config . + if [[ $(ssh -V 2>&1 | grep -c SSH_8.8) == 1 || $(ssh -V 2>&1 | grep -c SSH_8.9) == 1 || + $(ssh -V 2>&1 | grep -c SSH_9.) == 1 || $(ssh -V 2>&1 | grep -c SSH_10.) == 1 ]]; then + echo " PubkeyAcceptedAlgorithms +ssh-rsa" >> ssh_config + fi scp2="scp -F ../resources/ssh_config" ssh2="ssh -F ../resources/ssh_config" }