summaryrefslogtreecommitdiff
path: root/core/openssh/sshdgenkeys.service
diff options
context:
space:
mode:
Diffstat (limited to 'core/openssh/sshdgenkeys.service')
-rw-r--r--core/openssh/sshdgenkeys.service18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/openssh/sshdgenkeys.service b/core/openssh/sshdgenkeys.service
new file mode 100644
index 000000000..47c1c3fd6
--- /dev/null
+++ b/core/openssh/sshdgenkeys.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=SSH Key Generation
+ConditionPathExists=|!/etc/ssh/ssh_host_key
+ConditionPathExists=|!/etc/ssh/ssh_host_key.pub
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key.pub
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key.pub
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key.pub
+
+[Service]
+ExecStart=/usr/bin/ssh-keygen -A
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target