Commit 450a05ba authored by Peter Hutterer's avatar Peter Hutterer
Browse files

bootstrap: write all the ssh configuration into our config file



Let's have a single place where we define our ssh options. The only except is
the initial connect where we want to allow new host keys - that is passed in
as commandline option.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 10b1809b
......@@ -33,15 +33,19 @@ do_start() {
if [[ ! -e /etc/ssh/ssh_config.d/99-vm.conf ]]; then
cat >/etc/ssh/ssh_config.d/99-vm.conf <<EOF
ControlMaster auto
ControlPersist 5
Host vm
HostName localhost
Port 5555
PubkeyAcceptedKeyTypes ssh-rsa
EOF
fi
# Connect once to store the host key locally
if [[ $exit_code -eq 0 ]]; then
ssh -o StrictHostKeyChecking=accept-new -o PubkeyAcceptedKeyTypes=ssh-rsa vm uname -a
ssh -o StrictHostKeyChecking=accept-new vm uname -a
exit_code=$?
fi
......@@ -99,7 +103,7 @@ do_stop() {
do_exec() {
set -x
ssh -oControlMaster=auto -oControlPersist=5 -oPubkeyAcceptedKeyTypes=ssh-rsa vm "$@"
ssh vm "$@"
}
case $1 in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment