From f30878e33287c03269e213e44d39a81214c0627e Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Thu, 27 Oct 2016 21:18:15 -0400 Subject: [PATCH] Add Packer config make ssh auth work by default Recent versions of Fedora don't use ssh-dss, which old versions of ODL seem to offer by default. Can fix with a system config change like this or by manually passing as option to ssh command. The csit and l2switch tutorials do it by changing this configuration. vagrant-opendaylight's connect.sh helper script is an example of passing the param to ssh CLI. There might be a better way/place to fix this. Ideas encouraged. Change-Id: Id143fa6bc864469926596dfaddb77902f6d8c68f Signed-off-by: Daniel Farrell --- packer/provision/config_ssh.sh | 14 ++++++++++++++ packer/templates/docker.json | 3 ++- packer/templates/libvirt.json | 3 ++- packer/templates/virtualbox.json | 3 ++- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 packer/provision/config_ssh.sh diff --git a/packer/provision/config_ssh.sh b/packer/provision/config_ssh.sh new file mode 100644 index 0000000..f0376c7 --- /dev/null +++ b/packer/provision/config_ssh.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Recent versions of OpenSSH don't support ssh-dss as an auth protocol +# ODL seems offers ssh-dss by default. To SSH to the Karaf shell, tell +# SSH to accept ssh-dss. Alternatively, tell SSH to accept ssh-dss via +# the HostKeyAlgorithms option at invocation. +# ssh -p 8101 -oHostKeyAlgorithms=+ssh-dss karaf@localhost + +# Options: +# -x: Echo commands +# -e: Fail on errors +set -ex + +# Accept ssh-dss as an SSH algorithm by appending config to end of file +sudo sed -i -e "\$aHostKeyAlgorithms=+ssh-dss" /etc/ssh/ssh_config diff --git a/packer/templates/docker.json b/packer/templates/docker.json index 6e3776a..c5e9a9e 100644 --- a/packer/templates/docker.json +++ b/packer/templates/docker.json @@ -21,7 +21,8 @@ "scripts": [ "provision/config_docker_{{ user `os_name`}}.sh", - "provision/config_ansible_{{ user `os_name`}}.sh" + "provision/config_ansible_{{ user `os_name`}}.sh", + "provision/config_ssh.sh" ] }, { diff --git a/packer/templates/libvirt.json b/packer/templates/libvirt.json index 65145f4..daf97f7 100644 --- a/packer/templates/libvirt.json +++ b/packer/templates/libvirt.json @@ -30,7 +30,8 @@ "scripts": [ "provision/config_vagrant.sh", - "provision/config_ansible_{{ user `os_name`}}.sh" + "provision/config_ansible_{{ user `os_name`}}.sh", + "provision/config_ssh.sh" ] }, { diff --git a/packer/templates/virtualbox.json b/packer/templates/virtualbox.json index 127e8fa..08acc4d 100644 --- a/packer/templates/virtualbox.json +++ b/packer/templates/virtualbox.json @@ -47,7 +47,8 @@ [ "provision/config_virtualbox_{{ user `os_name`}}.sh", "provision/config_vagrant.sh", - "provision/config_ansible_{{ user `os_name`}}.sh" + "provision/config_ansible_{{ user `os_name`}}.sh", + "provision/config_ssh.sh" ] }, { -- 2.36.6