Fix CMD: Generate host keys in correct custom directory

This commit is contained in:
2026-02-02 02:56:25 +00:00
parent 51cb4aa795
commit 0b95ba72b3

View File

@@ -34,5 +34,5 @@ WORKDIR /data
EXPOSE 2222 EXPOSE 2222
# Start SSH daemon # Start SSH daemon
# Generate host keys on startup if missing (for ephemeral pods) # Fix: Explicitly generate keys into the custom host_keys directory
CMD ["/bin/bash", "-c", "ssh-keygen -A && /usr/sbin/sshd -D -f /etc/ssh/sshd_config"] CMD ["/bin/bash", "-c", "ssh-keygen -f /etc/ssh/host_keys/ssh_host_rsa_key -N '' -t rsa && ssh-keygen -f /etc/ssh/host_keys/ssh_host_ecdsa_key -N '' -t ecdsa && ssh-keygen -f /etc/ssh/host_keys/ssh_host_ed25519_key -N '' -t ed25519 && /usr/sbin/sshd -D -f /etc/ssh/sshd_config"]