]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/misc-progs/sshctrl.c
Added the possibility to change the ssh port from 222 back to standart port 22
[people/pmueller/ipfire-2.x.git] / src / misc-progs / sshctrl.c
index 52515ea8e1dedd682e173adf6166fd4f8936896d..0bdc5834808e45bde4526a0aa8c86e24303cc0d1 100644 (file)
@@ -70,9 +70,14 @@ int main(int argc, char *argv[])
                                                strlcat(command, "s/^PasswordAuthentication .*$/PasswordAuthentication yes/;", STRING_SIZE - 1 );
 
                                if(findkey(kv, "ENABLE_SSH_PORTFW", buffer) && !strcmp(buffer,"on"))
-                                               strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding yes/", STRING_SIZE - 1 );
+                                               strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding yes/;", STRING_SIZE - 1 );
                                else
-                                               strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding no/", STRING_SIZE - 1 );
+                                               strlcat(command, "s/^AllowTcpForwarding .*$/AllowTcpForwarding no/;", STRING_SIZE - 1 );
+                                               
+                               if(findkey(kv, "SSH_PORT", buffer) && !strcmp(buffer,"on"))
+                                               strlcat(command, "s/^Port .*$/Port 22/", STRING_SIZE - 1 );
+                               else
+                                               strlcat(command, "s/^Port .*$/Port 222/", STRING_SIZE - 1 );
 
                                freekeyvalues(kv);