nixos/ec2: Fix typo, chown -> chmod

This commit is contained in:
r-vdp 2024-10-10 09:02:06 +02:00
parent 05acf33131
commit 11d9033d85
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ with lib;
if ! [ -e /root/.ssh/authorized_keys ]; then
echo "obtaining SSH key..."
mkdir -p /root/.ssh
chown 0700 /root/.ssh
chmod 0700 /root/.ssh
if [ -s /etc/ec2-metadata/public-keys-0-openssh-key ]; then
(umask 177; cat /etc/ec2-metadata/public-keys-0-openssh-key >> /root/.ssh/authorized_keys)
echo "new key added to authorized_keys"
@ -47,7 +47,7 @@ with lib;
userData=/etc/ec2-metadata/user-data
mkdir -p /etc/ssh
chown 0755 /etc/ssh
chmod 0755 /etc/ssh
if [ -s "$userData" ]; then
key="$(sed 's/|/\n/g; s/SSH_HOST_DSA_KEY://; t; d' $userData)"

View File

@ -1,6 +1,6 @@
metaDir=/etc/ec2-metadata
mkdir -p "$metaDir"
chown 0755 "$metaDir"
chmod 0755 "$metaDir"
rm -f "$metaDir/*"
get_imds_token() {