Set same permissions for /root/.ssh/authorized_keys

in post-tasks.d/010fix-ssh-perms as is done by
Puppet with sunet::ssh_keys.
This commit is contained in:
John Van de Meulebrouck Brendgard 2023-11-17 13:50:02 +01:00
parent 1bd6524ad3
commit ca353ed406
No known key found for this signature in database
GPG key ID: 807A5FD4B3337B77

View file

@ -17,7 +17,7 @@ if test -f /root/.ssh/authorized_keys; then
if test `stat -t /root/.ssh/authorized_keys | cut -d\ -f5` != 0; then if test `stat -t /root/.ssh/authorized_keys | cut -d\ -f5` != 0; then
chown root.root /root/.ssh/authorized_keys chown root.root /root/.ssh/authorized_keys
fi fi
if test `stat --printf=%a /root/.ssh/authorized_keys` != 600; then if test `stat --printf=%a /root/.ssh/authorized_keys` != 440; then
chmod 600 /root/.ssh/authorized_keys chmod 440 /root/.ssh/authorized_keys
fi fi
fi fi