Browse Source

Don't generate keys if they are already there

master
parent
commit
89c4101c32
  1. 5
      entrypoint.sh

5
entrypoint.sh

@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
#!/bin/bash
# This won't be executed if keys already exist (i.e. from a volume)
ssh-keygen -t ecdsa -f /etc/ssh/host_keys/ssh_host_ecdsa_key
ssh-keygen -t df25519 -f /etc/ssh/host_keys/ssh_host_ed25519_key
[ ! -f /etc/ssh/host_keys/ssh_host_ecdsa_key ] && ssh-keygen -t ecdsa -f /etc/ssh/host_keys/ssh_host_ecdsa_key
[ ! -f /etc/ssh/host_keys/ssh_host_ed25519_key] && ssh-keygen -t ed25519 -f /etc/ssh/host_keys/ssh_host_ed25519_key
# Copy authorized keys from ENV variable
echo "$AUTHORIZED_KEYS" >$AUTHORIZED_KEYS_FILE

Loading…
Cancel
Save