public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "Q. Gylstorff" <Quirin.Gylstorff@siemens.com>
Cc: <isar-users@googlegroups.com>, <jan.kiszka@siemens.com>
Subject: Re: [PATCH] sshd-regen-keys: Disable service after it run once
Date: Thu, 18 Nov 2021 13:59:24 +0100	[thread overview]
Message-ID: <20211118135924.6fd0e2c1@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20211118115025.182309-1-Quirin.Gylstorff@siemens.com>

Am Thu, 18 Nov 2021 12:50:25 +0100
schrieb "Q. Gylstorff" <Quirin.Gylstorff@siemens.com>:

> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> sshd-regen-keys is executed every time the system boots.
> This leads to new system ssh keys every boot.

New keys on every boot should not happen!

SSH-KEYGEN(1)
-A      For each of the key types (rsa, dsa, ecdsa and ed25519)
        for which host keys do not exist, ...

So yes you will see the service active/enabled/running but they keys
should only be created on the first boot. If not please share your
distro and version of ssh-keygen. (maybe it differs across versions)

Henning

> Revert to the behavior to before
> commit d700bf83042c57efdc4f4721f56d078433ce6b1d sshd-regen-keys:
> Improve service, make more robust
> 
> and disable the service after it was executed.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  .../sshd-regen-keys/files/sshd-regen-keys.service                | 1
> + .../{sshd-regen-keys_0.4.bb => sshd-regen-keys_0.5.bb}           | 0
>  2 files changed, 1 insertion(+)
>  rename meta/recipes-support/sshd-regen-keys/{sshd-regen-keys_0.4.bb
> => sshd-regen-keys_0.5.bb} (100%)
> 
> diff --git
> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
> index 5c2ccff7..b38e6edc 100644 ---
> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
> +++
> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.service
> @@ -11,6 +11,7 @@ ConditionPathIsReadWrite=/etc Type=oneshot
> RemainAfterExit=yes ExecStart=/usr/bin/ssh-keygen -A
> +ExecStartPost=-/bin/systemctl disable sshd-regen-keys.service 
>  [Install]
>  WantedBy=sysinit.target
> diff --git
> a/meta/recipes-support/sshd-regen-keys/sshd-regen-keys_0.4.bb
> b/meta/recipes-support/sshd-regen-keys/sshd-regen-keys_0.5.bb
> similarity index 100% rename from
> meta/recipes-support/sshd-regen-keys/sshd-regen-keys_0.4.bb rename to
> meta/recipes-support/sshd-regen-keys/sshd-regen-keys_0.5.bb


      reply	other threads:[~2021-11-18 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 11:50 Q. Gylstorff
2021-11-18 12:59 ` Henning Schild [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211118135924.6fd0e2c1@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=Quirin.Gylstorff@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox