Add Packer config make ssh auth work by default 12/47712/2
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 28 Oct 2016 01:18:15 +0000 (21:18 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 2 Nov 2016 00:23:35 +0000 (00:23 +0000)
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 <dfarrell@redhat.com>
packer/provision/config_ssh.sh [new file with mode: 0644]
packer/templates/docker.json
packer/templates/libvirt.json
packer/templates/virtualbox.json

diff --git a/packer/provision/config_ssh.sh b/packer/provision/config_ssh.sh
new file mode 100644 (file)
index 0000000..f0376c7
--- /dev/null
@@ -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
index 6e3776ac86394cd2436efe8ccda957f53146649c..c5e9a9ed9d8706f6604eedf1e91ad09f585f0975 100644 (file)
@@ -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"
         ]
     },
     {
index 65145f4146b1dcb6fc997626d17e1b2baf456eb2..daf97f7eece107ca019b14433550f1c4bd2066dd 100644 (file)
@@ -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"
         ]
     },
     {
index 127e8fad8e07ef4b7845f1368408d93dbb8be1d3..08acc4d27c7747e80515a9a77386f0b5d8ac675d 100644 (file)
@@ -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"
         ]
     },
     {