Skip to content

Commit

Permalink
Change host key permission to 600 and avoid error
Browse files Browse the repository at this point in the history
  • Loading branch information
atmoz committed Aug 8, 2020
1 parent 4e4726a commit cd5d032
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions files/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ if [ ! -f "$userConfFinalPath" ]; then
# Generate unique ssh keys for this container, if needed
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
else
chmod 700 /etc/ssh/ssh_host_ed25519_key
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
else
chmod 700 /etc/ssh/ssh_host_rsa_key
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

# Source custom scripts, if any
Expand Down

0 comments on commit cd5d032

Please sign in to comment.