From: Michael Tremer Date: Sat, 14 Jul 2018 14:06:39 +0000 (+0100) Subject: AWS: Give setup user permissions to read its own SSH keys X-Git-Tag: v2.21-core123~56 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=6a7e6b4499115e52cc6ec1abb799f6a7d14d2168 AWS: Give setup user permissions to read its own SSH keys Signed-off-by: Michael Tremer --- diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup index 2f4300d17d..d8c7a358cb 100644 --- a/src/initscripts/helper/aws-setup +++ b/src/initscripts/helper/aws-setup @@ -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