From b438d5f41b064c84603d74717a410a02b37f8584 Mon Sep 17 00:00:00 2001 From: Dmitry Mikhin Date: Wed, 9 Aug 2023 15:49:48 +0300 Subject: [PATCH] fix #203, sshd -T cannot be executed after /etc/ssh/*_key* deletion --- products-prepare/linux/yc-image-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products-prepare/linux/yc-image-cleanup.sh b/products-prepare/linux/yc-image-cleanup.sh index d03a86fb..4e27884f 100755 --- a/products-prepare/linux/yc-image-cleanup.sh +++ b/products-prepare/linux/yc-image-cleanup.sh @@ -699,7 +699,7 @@ function noOneUserHasKeyPairs { function noPasswordAuthSSH { V="$1" - CONF_VAULE=$(sshd -T 2>/dev/null | sed -n 's/^passwordauthentication \(.*\)/\1/p') + CONF_VAULE=$(cat /etc/ssh/sshd_config 2>/dev/null | sed -n 's/^PasswordAuthentication \(.*\)/\1/p') if [ "$V" == "normal" ]; then DETAILS=" Details: passwordauthentication ${CONF_VAULE}" fi