Skip to content

Commit

Permalink
change ssh-keygen commands for add default host keys
Browse files Browse the repository at this point in the history
  • Loading branch information
eshizhan committed Mar 24, 2024
1 parent fd87bcb commit 052a885
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 1 addition & 9 deletions files/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@ 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 ''
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
fi

# Restrict access from other users
chmod 600 /etc/ssh/ssh_host_ed25519_key || true
chmod 600 /etc/ssh/ssh_host_rsa_key || true
ssh-keygen -A
fi

# Source custom scripts, if any
Expand Down
1 change: 1 addition & 0 deletions files/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Protocol 2
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key

# Faster connection
# See: https://github.com/atmoz/sftp/issues/11
Expand Down

0 comments on commit 052a885

Please sign in to comment.