From 0240f960850290f08b8dbdd11492a7010fc97e0b Mon Sep 17 00:00:00 2001
From: Yangyang Shen <shenyy1994@163.com>
Date: Tue, 27 Jun 2023 19:03:01 +0800
Subject: [PATCH] fix: modify units for sctl enable

---
 units/sshd-keygen@ecdsa.service   | 3 +++
 units/sshd-keygen@ed25519.service | 3 +++
 units/sshd-keygen@rsa.service     | 3 +++
 units/sshd.service                | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/units/sshd-keygen@ecdsa.service b/units/sshd-keygen@ecdsa.service
index a690fe1..8202d24 100644
--- a/units/sshd-keygen@ecdsa.service
+++ b/units/sshd-keygen@ecdsa.service
@@ -6,3 +6,6 @@ ConditionFileNotEmpty="|!/etc/ssh/ssh_host_ecdsa_key"
 Type="oneshot"
 EnvironmentFile="-/etc/sysconfig/sshd"
 ExecStart="/usr/libexec/openssh/sshd-keygen ecdsa"
+
+[Install]
+WantedBy="sshd-keygen.target"
diff --git a/units/sshd-keygen@ed25519.service b/units/sshd-keygen@ed25519.service
index 30237d3..7f4dd31 100644
--- a/units/sshd-keygen@ed25519.service
+++ b/units/sshd-keygen@ed25519.service
@@ -6,3 +6,6 @@ ConditionFileNotEmpty="|!/etc/ssh/ssh_host_ed25519_key"
 Type="oneshot"
 EnvironmentFile="-/etc/sysconfig/sshd"
 ExecStart="/usr/libexec/openssh/sshd-keygen ed25519"
+
+[Install]
+WantedBy="sshd-keygen.target"
diff --git a/units/sshd-keygen@rsa.service b/units/sshd-keygen@rsa.service
index 209edff..a30a1e5 100644
--- a/units/sshd-keygen@rsa.service
+++ b/units/sshd-keygen@rsa.service
@@ -6,3 +6,6 @@ ConditionFileNotEmpty="|!/etc/ssh/ssh_host_rsa_key"
 Type="oneshot"
 EnvironmentFile="-/etc/sysconfig/sshd"
 ExecStart="/usr/libexec/openssh/sshd-keygen rsa"
+
+[Install]
+WantedBy="sshd-keygen.target"
diff --git a/units/sshd.service b/units/sshd.service
index 762b8bb..7779e4e 100644
--- a/units/sshd.service
+++ b/units/sshd.service
@@ -12,3 +12,6 @@ ExecReload="/bin/kill -HUP $MAINPID"
 KillMode="process"
 Restart="on-failure"
 RestartSec=42
+
+[Install]
+WantedBy="multi-user.target"
-- 
2.33.0

