AWS: Give setup user permissions to read its own SSH keys

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2018-07-14 15:06:39 +01:00
parent 87d7fc6609
commit 6a7e6b4499

View File

@@ -101,9 +101,11 @@ import_aws_configuration() {
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
mkdir -p "/home/setup/.ssh"
chmod 700 "/home/setup/.ssh"
chown setup.nobody "/home/setup/.ssh"
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
chmod 600 "/home/setup/.ssh/authorized_keys"
chown setup.nobody "/home/setup/.ssh/authorized_keys"
fi
done