From 50bdb409d2980b00db22dd777374377a84aff8ec Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Fri, 13 Jan 2017 12:32:21 +0100 Subject: [PATCH] Use ssh-keygen -A to generate host keys 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. --- etc/grml/fai/config/files/etc/systemd/system/ssh.service/GRMLBASE | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/etc/grml/fai/config/files/etc/systemd/system/ssh.service/GRMLBASE b/etc/grml/fai/config/files/etc/systemd/system/ssh.service/GRMLBASE index 1345898..0b5581d 100644 --- a/etc/grml/fai/config/files/etc/systemd/system/ssh.service/GRMLBASE +++ b/etc/grml/fai/config/files/etc/systemd/system/ssh.service/GRMLBASE @@ -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 -- 2.1.4