From patchwork Tue Apr 9 02:35:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 2188 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id 4231288DACA for ; Mon, 8 Apr 2019 17:35:57 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 44dGJD5xSFz5D0ND; Mon, 8 Apr 2019 17:35:56 +0100 (BST) Received: from [127.0.0.1] (163-172-12-160.rev.poneytelecom.eu [163.172.12.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 44dGJ86nslz5D0ND for ; Mon, 8 Apr 2019 17:35:52 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904rsa; t=1554741353; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=HwnYaPLWA4lqGos5nVHs2VJh6L4TOI37iJ9q8FwONkc=; b=A/gGUYLBh9/7eoUshEnDERUyF/yZff1VzhOVi5AZAeqUshoW5f87jS2+aSNDho00huSSM1 nPx1VRhW8IOTEQKzYk5Wte2rKN7+Ww3kJrHn5jcu8mNHpfFOgSGLnbJBD0Sth4+4b8ZwF5 pTgjAxcH0N5x0LVN6BxmJGhMrwI0PXz06OBT6Lnb9Yq7bT7sO02FubegpOPVns2Oh0ErcQ BZb+23u3FhVWLle84XlRIjbHgcjSxDatBVRcXsWAQe6ZhQSOjKXxsFjUIvMnXiGIZDTDRA qq7bTFEYktW/ZK+fOCKulJ3ptkH5+2Q9YseZOpycMwYPIavoK41oQTp6ke5o3Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904ed25519; t=1554741353; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=HwnYaPLWA4lqGos5nVHs2VJh6L4TOI37iJ9q8FwONkc=; b=3ApY4AFmgLE8gR262E/8WVWNEh41DAISfcDw/VbpPCbOWXbvIls8EUw8V6oMfzxQBYQTXV f5JCqXy1hiXZWPAQ== To: "IPFire: Development-List" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH 3/3] change AllowAgentForwarding in SSHD configuration if, necessary Organization: IPFire.org Message-ID: <3222f6d5-4cb7-1914-609e-9856fb5ff73d@ipfire.org> Date: Mon, 08 Apr 2019 16:35:00 +0000 MIME-Version: 1.0 Content-Language: en-US Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=pmueller smtp.mailfrom=peter.mueller@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Fixes #11931 Signed-off-by: Peter Müller Cc: Michael Tremer --- src/misc-progs/sshctrl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/misc-progs/sshctrl.c b/src/misc-progs/sshctrl.c index 30074973d..476dbc9d5 100644 --- a/src/misc-progs/sshctrl.c +++ b/src/misc-progs/sshctrl.c @@ -76,6 +76,11 @@ int main(int argc, char *argv[]) else strlcat(command, "s/^Port .*$/Port 222/", STRING_SIZE - 1 ); + if(findkey(kv, "SSH_AGENT_FORWARDING", buffer) && !strcmp(buffer,"on")) + strlcat(command, "s/^AllowAgentForwarding .*$/AllowAgentForwarding yes/;", STRING_SIZE - 1 ); + else + strlcat(command, "s/^AllowAgentForwarding .*$/AllowAgentForwarding no/;", STRING_SIZE - 1 ); + freekeyvalues(kv); snprintf(buffer, STRING_SIZE - 1, "' /etc/ssh/sshd_config >&%d", config_fd );