summaryrefslogtreecommitdiffstats
path: root/scripts/copy_keys.sh
diff options
context:
space:
mode:
authorJuraj Linkeš <jlinkes@cisco.com>2017-03-13 16:11:52 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-13 16:11:52 +0000
commitab5296b9a6779c027c9cf2b22bfd6e79c9f3b0b6 (patch)
tree965ec604648bc8889f9014cdde84dad0ff7df831 /scripts/copy_keys.sh
parente98d863ae414a55b1d306f66f0b54aa659a2c9ae (diff)
parent27bc51931cd80724e5638709a7746496cd5151c2 (diff)
Merge "Added draft of post apex deployment script"
Diffstat (limited to 'scripts/copy_keys.sh')
-rwxr-xr-xscripts/copy_keys.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/copy_keys.sh b/scripts/copy_keys.sh
new file mode 100755
index 0000000..062e4a7
--- /dev/null
+++ b/scripts/copy_keys.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+if [[ $# -ne 1 ]]
+then
+ echo "Must have one argument which is the ip of the host to which the key will be copied"
+ exit 1
+fi
+scp -oStrictHostKeyChecking=no /home/stack/id_rsa_jumphost_root.pub heat-admin@$1:/home/heat-admin
+ssh -oStrictHostKeyChecking=no heat-admin@$1 'cat /home/heat-admin/id_rsa_jumphost_root.pub >> /home/heat-admin/.ssh/authorized_keys'
+ssh -oStrictHostKeyChecking=no heat-admin@$1 'cat /home/heat-admin/id_rsa_jumphost_root.pub | sudo tee -a /root/.ssh/authorized_keys'
+ssh -oStrictHostKeyChecking=no heat-admin@$1 'rm -f /home/heat-admin/id_rsa_jumphost_root.pub'