Skip to content

Commit b93e846

Browse files
authored
Merge pull request #3 from geraldcor/issue-161-malformed-authorized-keys
Resolves atmoz#161. The method ensures a newline is added every time durin…
2 parents 52c0652 + f47e625 commit b93e846

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)