From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6932823963683782656 X-Received: by 2002:a05:6402:1854:: with SMTP id v20mr1603447edy.56.1614238864589; Wed, 24 Feb 2021 23:41:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:f28a:: with SMTP id gu10ls2276993ejb.1.gmail; Wed, 24 Feb 2021 23:41:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrhS+/2+eXHpkX6Jzr4JuC2K8ALdMGjDZrWMPI0HdCN4yt0BDR+db1gl6dNEmNUHvw2RSn X-Received: by 2002:a17:906:3388:: with SMTP id v8mr1464621eja.278.1614238863772; Wed, 24 Feb 2021 23:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614238863; cv=none; d=google.com; s=arc-20160816; b=oAnPBQQIsagSBGDcD/PvInQxjXzg5noZ2j6zhW/F3PLSE3xocu5F5fSru+xKSb00VH P1oT8i3LqKIRCryTX/JMiGrNKAAJlTRVpGtQIJ+DbW9aC0FFDEqk7z/LIm9G7o5I4JDB z1WBqhg/eh30cT/IbCj6J8iyagKyERqRR4lVWo1Gn3jgdjbrjzZgG1185+U0hmDcDOnp MX1LjvkQPPHOPjbeL6McE75pH1thWDEhqfXkbbGgm9UNCQ4gGyxaRAbdmKJTAiVOspwO if266ykU9CFuRdY++CnkETo/zbeM3m3G7To12b7Om/Wi1kbGDRvUilyaW48CEhc4ordc o9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=2Hg3+2twQ+CyMhwbI57/gH9I8kEaIWdnVLmIKP/TVYg=; b=fyagJ1QMWAOIfMgmD/Vzr7wwmanFOBWWfiE/irnQHbtxGTcB2fKHnDiv+8yYSGZCMc WZRFMHpAeke8Y85F8J8bt2QWNQ01Qrri5WzBu0bS/0tJwzMj7wQcEtuZLlJjcfEO5q3C kC0MC9VaQntzOkP6ZtmsWF3kSkJZhIvhZ2rtfJ2nZRDttP18HrlFBeGnBbnMas8V0wpN qmOAsLXSLtudBOsZgKZWYO44gDRk5tWLYuH0m8SdAsoxHzthdprO5cwmZo7nSqITB4BD Usr2oJ4oT5JpNYiClmLACTh8HAtIPR9HHfPeIPKLQgKzqQfeqxYtXpfsbsW6jPLzcTwE KxZQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id s18si201311edq.0.2021.02.24.23.41.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2021 23:41:03 -0800 (PST) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 11P7f3oU001599 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Feb 2021 08:41:03 +0100 Received: from [167.87.33.36] ([167.87.33.36]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 11P7a2lL025332; Thu, 25 Feb 2021 08:36:03 +0100 Subject: Re: [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled To: Henning Schild Cc: isar-users@googlegroups.com References: <20210224133242.30108-1-Quirin.Gylstorff@siemens.com> <20210224134145.31094-1-Quirin.Gylstorff@siemens.com> <20210224212612.430a20f8@md1za8fc.ad001.siemens.net> <20210224213248.55b6ad55@md1za8fc.ad001.siemens.net> From: Gylstorff Quirin Message-ID: <56c9e8ad-e1af-b8a7-e778-f8ffd4d0d426@siemens.com> Date: Thu, 25 Feb 2021 08:36:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210224213248.55b6ad55@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: rLG/cXBXPNz4 On 2/24/21 9:32 PM, Henning Schild wrote: > Am Wed, 24 Feb 2021 21:26:12 +0100 > schrieb "[ext] Henning Schild" : > >> Am Wed, 24 Feb 2021 14:41:45 +0100 >> schrieb "[ext] Q. Gylstorff" : >> >>> From: Quirin Gylstorff >>> >>> The code 'test -n $SSHD_ENABLED' always returns "0" and enables ssh >>> even if deactivated previously. >>> >>> Signed-off-by: Quirin Gylstorff >>> --- >>> Changes V2: >>> add missing space >>> meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh | 2 >>> +- 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git >>> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh >>> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh >>> index 910d879..50f45eb 100644 --- >>> a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh +++ >>> b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh @@ >>> -12,7 +12,7 @@ rm -v /etc/ssh/ssh_host_*_key* echo "Regenerating >>> keys ..." dpkg-reconfigure openssh-server >>> -if test -n $SSHD_ENABLED; then >>> +if [ -n "$SSHD_ENABLED" ]; then >> >> Not sure i understand that. But i guess 'test -n "$SSHD_ENABLED"' >> would also work, so we are looking at a quoting problem and the whole >> [] is just syntactic sugar. >> >> Sugar i would approve, just asking. > > If it is all about quoting, maybe the commit message can be improved to > reflect that. > > Henning It is a quoting problem. I will add some text to the commit message and send a v3. Quirin > >> Henning >> >>> echo "Reenabling ssh server ..." >>> systemctl enable --no-reload ssh >>> fi >> >