Merge pull request #304362 from Stunkymonkey/ec2-data-chmod-install

ec2-data: prefer 'install/umask' over 'chmod'
This commit is contained in:
Aleksana 2024-07-04 12:51:53 +08:00 committed by GitHub
commit d5a4f459ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,9 +35,8 @@ with lib;
echo "obtaining SSH key..."
mkdir -m 0700 -p /root/.ssh
if [ -s /etc/ec2-metadata/public-keys-0-openssh-key ]; then
cat /etc/ec2-metadata/public-keys-0-openssh-key >> /root/.ssh/authorized_keys
(umask 177; cat /etc/ec2-metadata/public-keys-0-openssh-key >> /root/.ssh/authorized_keys)
echo "new key added to authorized_keys"
chmod 600 /root/.ssh/authorized_keys
fi
fi