From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6932823963683782656 X-Received: by 2002:a05:651c:1391:: with SMTP id k17mr20310883ljb.508.1614198376740; Wed, 24 Feb 2021 12:26:16 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:a58c:: with SMTP id m12ls615209ljp.2.gmail; Wed, 24 Feb 2021 12:26:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjVdSdzydxz72LFdB9nVROcIupnJNbSfFe7XHsPufsdu5bXMRK6hVViNaCVr2QiXzqHbur X-Received: by 2002:a05:651c:288:: with SMTP id b8mr20190433ljo.133.1614198375733; Wed, 24 Feb 2021 12:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614198375; cv=none; d=google.com; s=arc-20160816; b=K/NMbvFmebKQTc33G0or7ncMIOWzbe47eBV0Na55m/tDGQfUyleEKeyCql6dNNxk/Q iSPm6BdCiatAwM98QiyhNucJgGLaiXwmh/jdSGqGVIuCtE45imrAPIS0E59g25kGWeGb 4Goad2t8V6DwDmH9Am+Ywd4iVk4YD0GgxUhEoIPeezpXkcBjTHm8qG9sz/tc2z26UQ/a mx0yxMMI92ddfSc5NTUXQztLcV8iTQgW5Mjn2c8PDnqoEb7o2RymcdTFNdr97dad6o9J a9MXDI4NeUB/p0P1hYgzXBlVu+38P9yWahNzbmIPK/4hq+XQ5+fPnNR64u1oqCBgkYYu +Sww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=KDQVWlR/UQlkMXoiOpasOwl8B72FQFZQd2EWrYqUlak=; b=Q/cjUnqs7/RLwNq2iC821O0ek8/z9pHaeDznDxRKVfpfBAySu4/dAnhOK1VmICx4yh 3kz/yoShQZk4URCHMvjRLVsFP0y0M41aT9UG8tF31JZ57l/YKnRlYtjKeW0BZR8+n+2L DGIs5eE1gCGxGH9l2Q3Ip9bXzhyFOwNTv4apEK2uDE75/Mqt1gRhnYPaznlH5F/3R0UB uXSiCegx2oacy5r4JiF8kAhOey9I5lYPQTxC9qqX9bfS8FWsCdA706Je9QMW0mk+JH1s Y7JsngVnHm2B+ScXujYPSdNIW9E6fGqITp9K1hihREBRw1hImIDYp8bwFtBU/OstklqS rD0A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@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 v3si152767lfd.4.2021.02.24.12.26.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2021 12:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 11OKQFq5014533 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 24 Feb 2021 21:26:15 +0100 Received: from md1za8fc.ad001.siemens.net ([167.87.35.103]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 11OKQEM2000881; Wed, 24 Feb 2021 21:26:14 +0100 Date: Wed, 24 Feb 2021 21:26:12 +0100 From: Henning Schild To: "[ext] Q. Gylstorff" Cc: isar-users@googlegroups.com Subject: Re: [PATCH v2] sshd-regen-keys: do not enable ssh server if previously disabled Message-ID: <20210224212612.430a20f8@md1za8fc.ad001.siemens.net> In-Reply-To: <20210224134145.31094-1-Quirin.Gylstorff@siemens.com> References: <20210224133242.30108-1-Quirin.Gylstorff@siemens.com> <20210224134145.31094-1-Quirin.Gylstorff@siemens.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: xAzqQzlsbOu0 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. Henning > echo "Reenabling ssh server ..." > systemctl enable --no-reload ssh > fi