]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
AWS: Give setup user permissions to read its own SSH keys
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Jul 2018 14:06:39 +0000 (15:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Jul 2018 14:06:39 +0000 (15:06 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/aws-setup

index 2f4300d17d6cdca7acd5da30648ac14adaa6bc4e..d8c7a358cb4015a65bf009b29956b7f1c194de53 100644 (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