mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
change AllowAgentForwarding in SSHD configuration if, necessary
Fixes #11931 Signed-off-by: Peter Müller <peter.mueller@ipfire.org> Cc: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
e918b62ae2
commit
f9de28e6f0
@@ -76,6 +76,11 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
strlcat(command, "s/^Port .*$/Port 222/", STRING_SIZE - 1 );
|
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);
|
freekeyvalues(kv);
|
||||||
|
|
||||||
snprintf(buffer, STRING_SIZE - 1, "' /etc/ssh/sshd_config >&%d", config_fd );
|
snprintf(buffer, STRING_SIZE - 1, "' /etc/ssh/sshd_config >&%d", config_fd );
|
||||||
|
|||||||
Reference in New Issue
Block a user