LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2008, 09:31 AM   #1
harriers
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Rep: Reputation: 0
Smile sending form to firewalled server using non-ssh server ?


Hello.

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.

thanks! Harri
 
Old 09-01-2008, 08:31 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Bypassing a firewall (iptables) has nothing to do with encryption (ssh).
If you are happy to pass your form unencrypted, then set apache to listen on port 80 as per normal.
If, for some reason you want encryption (eg money), get apache to listen on 443 (ssl) as well and use that port.
If the 2nd server 'firewalled' does not need to do webserving as such, don't use Apache, use an appropriate server or write your own.
What exactly are you trying to achieve. give a simple example.
PS every server should have iptables running. Try

iptables -L

on both to see.
 
Old 09-03-2008, 04:14 AM   #3
harriers
LQ Newbie
 
Registered: Sep 2008
Posts: 3

Original Poster
Rep: Reputation: 0
"What exactly are you trying to achieve. give a simple example."

Ok so: firewalled server has huge computing capabilities to process the files created on basis of form details. Formserver is a web hotel only that does not happen to have cgi-bin ('in-script') support for ssh actions: transferring the form from formserver to firewalled is the thing I'm trying to do but firewalled accepts only SSH traffic (not FTP) which is the problem. Installed apache on firewalled but accessing that from http://127.0.0.1:20008/form.html does not work.

I'm just wondering if it is my misconfiguration of apache or the SSH tunnel: ssh -R 20008:firewalled.fi:xx formserver.fi.

"then set apache to listen on port 80 as per normal. If, for some reason you want encryption (eg money), get apache to listen on 443 (ssl) as well and use that port." These ports 443/80 are actually reserved by the firewalled server itself, that's why I'm using 20008.

I'm not a programmer but have to do this (without having to upgrade to dedicated server).

thanks, Harri

ps. iptables -L does not work and can't get that module installed because I'm not admin on either server. I'm just visiting on both.
 
Old 09-03-2008, 08:55 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
So, we have 2 servers

1. a compute server aka 'firewalled'

2. a webserver aka 'formserver'

The user fills in a form on (2), which creates a file. You then need to scp (secure-copy: part of ssh toolkit) the file across to (1), where the data will be processed.
You'll want to use authorised-keys instead of passwd for the scp. (Given that this is a non-interactive op).

You'll then need a daemon on (1) that checks for incoming files to process.
Alternatively, write your own daemon for (1) and send the data direct to it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl/Web (www) server needs to use mail server for sending forms. dskv Linux - Server 4 04-08-2008 01:34 PM
our LAN's proxy server is firewalled disabling a movie download..plz help rs_vijay Linux - Networking 2 11-01-2007 02:35 AM
Connecting to firewalled SSH server BlueTornJacket Linux - Networking 3 02-04-2007 10:06 AM
Running An Apache 2.0 Server Internally Firewalled By Smoothwall davethegenius Linux - Software 3 11-02-2004 02:43 PM


All times are GMT -5. The time now is 08:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration