From: Peter Müller Date: Mon, 8 Apr 2019 16:35:00 +0000 (+0000) Subject: change AllowAgentForwarding in SSHD configuration if, necessary X-Git-Tag: v2.23-core131~42^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9de28e6f0ca455aacca3b0fc30722b88d542630;p=ipfire-2.x.git change AllowAgentForwarding in SSHD configuration if, necessary Fixes #11931 Signed-off-by: Peter Müller Cc: Michael Tremer Signed-off-by: Michael Tremer --- diff --git a/src/misc-progs/sshctrl.c b/src/misc-progs/sshctrl.c index 30074973da..476dbc9d54 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 );