1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

Dockerfile: copy ssh_host_*.pub keys to avoid sshd warnings

To overwrite default ones with the ones matching the copied private
keys.

Fixing in sshd log:
```
Public key for /etc/ssh/ssh_host_rsa_key does not match private key
Public key for /etc/ssh/ssh_host_ecdsa_key does not match private key
Public key for /etc/ssh/ssh_host_ed25519_key does not match private key
```

Closes #2614
This commit is contained in:
Viktor Szakats
2026-09-13 13:00:48 +02:00
parent 7bf89e2bb8
commit e3f1853298

View File

@@ -17,12 +17,15 @@ RUN [ -d /var/run/sshd ] || mkdir /var/run/sshd
# no effect (Docker AUFS-related bug maybe?)
# Host keys
COPY ssh_host_rsa_key.pub /etc/ssh/
COPY ssh_host_rsa_key /tmp/etc/ssh/
RUN install -m 0600 /tmp/etc/ssh/ssh_host_rsa_key /etc/ssh/
COPY ssh_host_ecdsa_key.pub /etc/ssh/
COPY ssh_host_ecdsa_key /tmp/etc/ssh/
RUN install -m 0600 /tmp/etc/ssh/ssh_host_ecdsa_key /etc/ssh/
COPY ssh_host_ed25519_key.pub /etc/ssh/
COPY ssh_host_ed25519_key /tmp/etc/ssh/
RUN install -m 0600 /tmp/etc/ssh/ssh_host_ed25519_key /etc/ssh/