All of lore.kernel.org
 help / color / mirror / Atom feed
* [isar-cip-core] security-customizations: Fix broken sshd_config in bookworm
@ 2023-06-30 11:34 Sai.Sathujoda
  2023-07-03 10:48 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Sai.Sathujoda @ 2023-06-30 11:34 UTC (permalink / raw)
  To: cip-dev, jan.kiszka; +Cc: Sai, dinesh.kumar, kazuhiro3.hayashi

From: Sai <Sai.Sathujoda@toshiba-tsip.com>

ChallengeResponseAuthentication configuration is sshd_config is deprecated from
bookworm, so modify the configuration setting based on its availability.

Signed-off-by: Sai <Sai.Sathujoda@toshiba-tsip.com>
---
 recipes-core/security-customizations/files/postinst | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 recipes-core/security-customizations/files/postinst

diff --git a/recipes-core/security-customizations/files/postinst b/recipes-core/security-customizations/files/postinst
old mode 100644
new mode 100755
index d370345..4438776
--- a/recipes-core/security-customizations/files/postinst
+++ b/recipes-core/security-customizations/files/postinst
@@ -82,5 +82,11 @@ if grep -c "pam_google_authenticator.so" "${SSHD_AUTH_CONFIG}";then
 fi
 echo "auth required pam_google_authenticator.so nullok" | tee -a "${SSHD_AUTH_CONFIG}"
 # Enable PAM configuration for Remote Session
-sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' "${SSHD_CONFIG}"
+if grep -s -q "ChallengeResponseAuthentication" "${SSHD_CONFIG}";then
+       sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' "${SSHD_CONFIG}"
+fi
+
+if grep -s -q "KbdInteractiveAuthentication" "${SSHD_CONFIG}";then
+       sed -i 's/KbdInteractiveAuthentication no/KbdInteractiveAuthentication yes/g' "${SSHD_CONFIG}"
+fi
 echo "AuthenticationMethods keyboard-interactive" | tee -a "${SSHD_CONFIG}"
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [isar-cip-core] security-customizations: Fix broken sshd_config in bookworm
  2023-06-30 11:34 [isar-cip-core] security-customizations: Fix broken sshd_config in bookworm Sai.Sathujoda
@ 2023-07-03 10:48 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2023-07-03 10:48 UTC (permalink / raw)
  To: Sai.Sathujoda, cip-dev; +Cc: dinesh.kumar, kazuhiro3.hayashi

On 30.06.23 13:34, Sai.Sathujoda@toshiba-tsip.com wrote:
> From: Sai <Sai.Sathujoda@toshiba-tsip.com>
> 
> ChallengeResponseAuthentication configuration is sshd_config is deprecated from
> bookworm, so modify the configuration setting based on its availability.
> 
> Signed-off-by: Sai <Sai.Sathujoda@toshiba-tsip.com>
> ---
>  recipes-core/security-customizations/files/postinst | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>  mode change 100644 => 100755 recipes-core/security-customizations/files/postinst
> 
> diff --git a/recipes-core/security-customizations/files/postinst b/recipes-core/security-customizations/files/postinst
> old mode 100644
> new mode 100755
> index d370345..4438776
> --- a/recipes-core/security-customizations/files/postinst
> +++ b/recipes-core/security-customizations/files/postinst
> @@ -82,5 +82,11 @@ if grep -c "pam_google_authenticator.so" "${SSHD_AUTH_CONFIG}";then
>  fi
>  echo "auth required pam_google_authenticator.so nullok" | tee -a "${SSHD_AUTH_CONFIG}"
>  # Enable PAM configuration for Remote Session
> -sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' "${SSHD_CONFIG}"
> +if grep -s -q "ChallengeResponseAuthentication" "${SSHD_CONFIG}";then
> +       sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' "${SSHD_CONFIG}"
> +fi
> +
> +if grep -s -q "KbdInteractiveAuthentication" "${SSHD_CONFIG}";then
> +       sed -i 's/KbdInteractiveAuthentication no/KbdInteractiveAuthentication yes/g' "${SSHD_CONFIG}"
> +fi
>  echo "AuthenticationMethods keyboard-interactive" | tee -a "${SSHD_CONFIG}"

Thanks, applied.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-03 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30 11:34 [isar-cip-core] security-customizations: Fix broken sshd_config in bookworm Sai.Sathujoda
2023-07-03 10:48 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.