Skip to content

Commit

Permalink
Use ssh-keygen -A to generate host keys
Browse files Browse the repository at this point in the history
ssh-keygen -A (from manpage):
  For each of the key types (rsa1, rsa, dsa, ecdsa and
  ed25519) for which host keys do not exist, generate the host keys
  with the default key file path, an empty passphrase, default bits for
  the key type, and default comment.  This is used by system
  administration scripts to generate new host keys.
  • Loading branch information
jkirk authored and mika committed Jan 27, 2017
1 parent 895467c commit 50bdb40
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -9,10 +9,7 @@ ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=-/bin/sh -c "[ ! -f /etc/ssh/ssh_host_rsa_key ] && /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N ''"
ExecStartPre=-/bin/sh -c "[ ! -f /etc/ssh/ssh_host_dsa_key ] && /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -C '' -N ''"
ExecStartPre=-/bin/sh -c "[ ! -f /etc/ssh/ssh_host_ecdsa_key ] && /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C '' -N ''"
ExecStartPre=-/bin/sh -c "[ ! -f /etc/ssh/ssh_host_ed25519_key ] && /usr/bin/ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -C '' -N ''"
ExecStartPre=-/bin/sh -c "/usr/bin/ssh-keygen -A"
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Expand Down

0 comments on commit 50bdb40

Please sign in to comment.