Skip to content

Commit 052a885

Browse files
committed
change ssh-keygen commands for add default host keys
1 parent fd87bcb commit 052a885

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

files/entrypoint

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,7 @@ if [ ! -f "$userConfFinalPath" ]; then
7171

7272
# Generate unique ssh keys for this container, if needed
7373
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
74-
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
75-
fi
76-
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
77-
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
78-
fi
79-
80-
# Restrict access from other users
81-
chmod 600 /etc/ssh/ssh_host_ed25519_key || true
82-
chmod 600 /etc/ssh/ssh_host_rsa_key || true
74+
ssh-keygen -A
8375
fi
8476

8577
# Source custom scripts, if any

files/sshd_config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Protocol 2
44
HostKey /etc/ssh/ssh_host_ed25519_key
55
HostKey /etc/ssh/ssh_host_rsa_key
6+
HostKey /etc/ssh/ssh_host_ecdsa_key
67

78
# Faster connection
89
# See: https://github.com/atmoz/sftp/issues/11

0 commit comments

Comments
 (0)