I have the following two-server problem:
HTML form on formserver should be able to send the form to a firewalled server. (I understand in order to bypass the firewall you would have to use SSH but the problem is that the formserver does not support SSH from cgi-bin script, only from commandline). If it did support, there would be no problem but is there a way to be able to do this?
This is what I've approximately tried so far:
- install apache on firewall server (had to do it myself), set httpd.conf to Listen 20008 so that I'm getting:
netstat -an | grep 20008
tcp 0 0 :::20008 :::* LISTEN
- create SSH tunnel from firewalled server to formserver:
ssh -R 20008:firewalled.fi:80 formserver.fi
(Problem is probably here: the idea with that port 80 is to allow HTTP traffic, the form, to come in. Not sure if I should or not have port 22 for SSH somewhere? Should I additionally have passwordless login from firewalled to formserver in place before I submit? or have some port with formserver?)
- then log into the formserver by opening the form at http://formserver.fi/form.html
and submit the form using <form action="http://127.0.0.1:20008/cgi-bin/form.pl">
This however gives either a lag or "could not connect".
Tried out several ssh lines I'm probably doing it wrong and would appreciate any pointers.