From 8f9d172e932a3bc9c66d5db2659eea4a416fa187 Mon Sep 17 00:00:00 2001
From: Martin Pietsch <martin.pietsch@tu-dresden.de>
Date: Fri, 22 Nov 2019 10:39:08 +0100
Subject: [PATCH] configuration of sshd added

---
 files/installer.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/files/installer.sh b/files/installer.sh
index 63df129..eaa06f2 100755
--- a/files/installer.sh
+++ b/files/installer.sh
@@ -14,3 +14,18 @@ then
   . /opt/runinstaller.sh
 fi
 
+beginLogEntry "install fstab in target"
+cp /tmp/fstab.local /target/etc/fstab
+finishLogEntry "done"
+
+beginLogEntry "configure ssh in target"
+sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin prohibit-password/g' /target/etc/ssh/sshd_config
+sed -i -e 's/^#AuthorizedKeysFile/AuthorizedKeysFile/g' /target/etc/ssh/sshd_config
+sed -i -e 's/^\(AuthorizedKeysFile.*\)$/\1 \/etc\/ssh\/authorized_keys/g' /target/etc/ssh/sshd_config 
+finishLogEntry "done"
+
+beginLogEntry "install ssh key in target"
+cp /opt/ansible.pub /target/etc/ssh/authorized_keys
+chmod 644 /target/etc/sshd/authorized_keys
+finishLogEntry "done"
+
-- 
GitLab