diff --git a/tools/pi_control/terminal_entry.sh b/tools/pi_control/terminal_entry.sh index dc6c675..15b615c 100644 --- a/tools/pi_control/terminal_entry.sh +++ b/tools/pi_control/terminal_entry.sh @@ -39,7 +39,12 @@ if [[ -z "${HOST}" || -z "${USER}" ]]; then exit 1 fi -SSH_OPTS=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null) +SSH_OPTS=() +if [[ "${PI_CONTROL_STRICT_HOSTKEY:-}" == "1" ]]; then + SSH_OPTS=(-o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/root/.ssh/known_hosts) +else + SSH_OPTS=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null) +fi if [[ "${AUTH_TYPE}" == "key" && -n "${KEY_PATH}" ]]; then exec ssh "${SSH_OPTS[@]}" -i "${KEY_PATH}" -p "${PORT:-22}" "${USER}@${HOST}"