From 68594bd6e16253d2f2977a4ab46713386e2482bd Mon Sep 17 00:00:00 2001
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Mon, 4 Feb 2019 16:03:06 +0100
Subject: [cfg01] Use ssh config to set default user & key

Change-Id: I7486569568207f7652f8bdfcf1060ce51a9dbb0e
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 mcp/scripts/docker-compose/files/entrypoint.sh | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'mcp/scripts/docker-compose/files')

diff --git a/mcp/scripts/docker-compose/files/entrypoint.sh b/mcp/scripts/docker-compose/files/entrypoint.sh
index eb549bc28..9830ea15f 100755
--- a/mcp/scripts/docker-compose/files/entrypoint.sh
+++ b/mcp/scripts/docker-compose/files/entrypoint.sh
@@ -16,6 +16,9 @@ fi
 if [ ! -f /home/ubuntu/.ssh/authorized_keys ]; then
     install -D -o ubuntu /root/fuel/mcp/scripts/mcp.rsa.pub \
                          /home/ubuntu/.ssh/authorized_keys
+    mkdir -p /root/.ssh/
+    echo 'User ubuntu' > /root/.ssh/config
+    echo 'IdentityFile /root/fuel/mcp/scripts/mcp.rsa' >> /root/.ssh/config
 fi
 
 if ! grep -q localhost /etc/hosts; then
-- 
cgit