Skip to content

Commit 8f5aa00

Browse files
committed
Use local known hosts file with SSH/rsync
Instead of ignoring host keys
1 parent 47b6981 commit 8f5aa00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ ssh_fn() {
233233

234234
local ret
235235

236-
set -- -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes "$@"
236+
set -- -q -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile="$results_folder/known_hosts" -o BatchMode=yes "$@"
237237
while ssh "$@"; ret=$?; [ $ret -eq 255 ]; do
238238
[ $retry = false ] && break
239239
err "Waiting to retry SSH: $*"
@@ -245,7 +245,7 @@ ssh_fn() {
245245

246246
rsync_fn() {
247247
local ret
248-
set -- -q -e 'ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes' "$@"
248+
set -- -q -e 'ssh -q -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile='"$results_folder"'/known_hosts -o BatchMode=yes' "$@"
249249
while rsync "$@"; ret=$?; [ $ret -ne 0 ] && [ $ret -ne 23 ]; do
250250
err "Waiting to retry rsync (failed with $ret): $*"
251251
sleep 10

0 commit comments

Comments
 (0)