Set authorized_keys to 0600 permissions

This commit is contained in:
Joshua Boniface 2019-12-14 13:15:55 -05:00 committed by Joshua Boniface
parent 6d19fd1772
commit 6493316194
1 changed files with 1 additions and 0 deletions

View File

@ -299,6 +299,7 @@ chroot ${target} useradd -u 200 -d /var/home/deploy -m -s /bin/bash -g operator
chroot ${target} mkdir -p /var/home/deploy/.ssh chroot ${target} mkdir -p /var/home/deploy/.ssh
if [[ -n ${target_keys_url} ]]; then if [[ -n ${target_keys_url} ]]; then
wget -O ${target}/var/home/deploy/.ssh/authorized_keys ${target_keys_url} wget -O ${target}/var/home/deploy/.ssh/authorized_keys ${target_keys_url}
chmod 0600 /var/home/deploy/.ssh/authorized_keys
else else
echo "${target_password}" | chroot ${target} passwd --stdin deploy >&2 echo "${target_password}" | chroot ${target} passwd --stdin deploy >&2
fi fi