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

Change host key permission to 600 and avoid error

See 4e4726aaa2 (commitcomment-41292709)
This commit is contained in:
Adrian Dvergsdal 2020-08-08 16:00:09 +02:00
parent 4e4726aaa2
commit cd5d03295a
No known key found for this signature in database
GPG key ID: C1E9E2D9552A42D2

View file

@ -67,14 +67,14 @@ if [ ! -f "$userConfFinalPath" ]; then
# Generate unique ssh keys for this container, if needed # Generate unique ssh keys for this container, if needed
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
else
chmod 700 /etc/ssh/ssh_host_ed25519_key
fi fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N '' ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
else
chmod 700 /etc/ssh/ssh_host_rsa_key
fi fi
# Restrict access from other users
chmod 600 /etc/ssh/ssh_host_ed25519_key || true
chmod 600 /etc/ssh/ssh_host_rsa_key || true
fi fi
# Source custom scripts, if any # Source custom scripts, if any