0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-17 12:51:33 -05:00

Properly concatenate public key so each key is separated by newline

This commit is contained in:
Pieter Lange 2018-01-23 22:29:45 +01:00
parent 87bd5bd594
commit 428707c086

View file

@ -88,7 +88,9 @@ function createUser() {
# Add SSH keys to authorized_keys with valid permissions # Add SSH keys to authorized_keys with valid permissions
if [ -d /home/$user/.ssh/keys ]; then if [ -d /home/$user/.ssh/keys ]; then
cat /home/$user/.ssh/keys/* >> /home/$user/.ssh/authorized_keys for publickey in /home/$user/.ssh/keys/*; do
cat $publickey >> /home/$user/.ssh/authorized_keys
done
chown $uid /home/$user/.ssh/authorized_keys chown $uid /home/$user/.ssh/authorized_keys
chmod 600 /home/$user/.ssh/authorized_keys chmod 600 /home/$user/.ssh/authorized_keys
fi fi