feat: generate SSH2 ED25519 HostKey during startup
This commit is contained in:
7
start.sh
7
start.sh
@@ -45,4 +45,11 @@ while [ "$USERADD" != "$i" ] ;do
|
||||
useradd --home-dir "$BASE_DIR/$USER_NAME" --uid "$USER_UID" --gid "$USER_GID" "$USER_NAME"
|
||||
done
|
||||
|
||||
if [ -z "$(find /etc/ssh/ -maxdepth 1 -name 'ssh_host_*_key' -print -quit)" ]; then
|
||||
echo "Creating SSH2 ED25519 key; this may take some time ..."
|
||||
ssh-keygen -q -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
|
||||
ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub
|
||||
echo "HostKey /etc/ssh/ssh_host_ed25519_key" >> /etc/ssh/sshd_config
|
||||
fi
|
||||
|
||||
exec /usr/sbin/sshd -D -e
|
||||
|
Reference in New Issue
Block a user