Skip to content

Commit f47e625

Browse files
author
Greg Corey
committed
Resolves atmoz#161. The method ensures a newline is added every time during the loop since the file is not closed out between >> operations.
1 parent bd437a0 commit f47e625

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/create-sftp-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fi
8383
# Add SSH keys to authorized_keys with valid permissions
8484
if [ -d "/home/$user/.ssh/keys" ]; then
8585
for publickey in "/home/$user/.ssh/keys"/*; do
86-
cat "$publickey" >> "/home/$user/.ssh/authorized_keys"
86+
(cat "${publickey}"; echo) >> "/home/$user/.ssh/authorized_keys"
8787
done
8888
chown "$uid" "/home/$user/.ssh/authorized_keys"
8989
chmod 600 "/home/$user/.ssh/authorized_keys"

0 commit comments

Comments
 (0)