From baa6ae495c04f41dffc30079aa416843254ed61d Mon Sep 17 00:00:00 2001 From: Razzi Abuissa Date: Tue, 3 Oct 2023 22:23:14 -0500 Subject: [PATCH] Use ronin known_hosts rather than writing to system one --- ronin | 7 ++++++- setup-ssh.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ronin b/ronin index 038882a..a0db6ed 100755 --- a/ronin +++ b/ronin @@ -51,7 +51,12 @@ ronin_launch() { } ronin_ssh() { - ssh -o 'ConnectionAttempts 3' ronin@localhost -p 2022 -i "$HOME/.ronin/ronin_key.priv" + ssh \ + -o 'ConnectionAttempts 3' \ + -o "UserKnownHostsFile $HOME/.ronin/known_hosts" \ + -p 2022 \ + -i "$HOME/.ronin/ronin_key.priv" \ + ronin@localhost } ronin_main() { diff --git a/setup-ssh.sh b/setup-ssh.sh index 972efe0..bd945c4 100755 --- a/setup-ssh.sh +++ b/setup-ssh.sh @@ -11,6 +11,6 @@ ronin_guest_sshd_key="$HOME/.ronin/guest_ssh_host_ed25519_key.pub" ssh_key_contents=$(cat "$ronin_guest_sshd_key") -echo "localhost $ssh_key_contents" >> "$HOME/.ssh/known_hosts" +echo "localhost $ssh_key_contents" >> "$HOME/.ronin/known_hosts" ssh-keygen -Hf "$HOME/.ssh/known_hosts" -- 2.45.2