Skip to main content

max / alloy

554 B · 19 lines History Blame Raw
1 #!/usr/bin/env bash
2 #
3 # sshx — run a command in the guest.
4 #
5 # The host key changes every time a disk is reinstalled, which is every case,
6 # so known-hosts checking is turned off rather than fought with. This reaches
7 # a throwaway VM on loopback and nothing else.
8 set -euo pipefail
9
10 # shellcheck source=build/layertest/common.sh
11 . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
12
13 exec ssh \
14 -o StrictHostKeyChecking=no \
15 -o UserKnownHostsFile=/dev/null \
16 -o LogLevel=ERROR \
17 -o ConnectTimeout=5 \
18 -p "$SSH_PORT" root@127.0.0.1 "$@"
19