views:

20

answers:

2

I have a server and client program. client is a java applet.
Previously I could run the server program in the server and the client successfully connected to the server program through the socket's proper port.

Now, I switched to a new server and I have problem with this server.
Direct connection (ssh) to this server (let say it is server1) is not possible.
I can connect a server2 (ssh), then connection to server1 is possible through the server2 (ssh).

So now my java applet cannot connect to server1 and it gives connection error.

Do you have any opinions how my applet can connect to server1 now??

A: 

If you want a server with a public access on a specific, you should concentrate on having have a public access and not try to connect every server to each other (via ssh).

A simple thing you could do for example is simple port forwarding from a public accessible server to your actual server (containing the java application). With this solution, you only have to change your client so it connects to the accessible server.

Colin Hebert
about port forwarding : my applet is accessible through server1 and applets can only connect to the server where it is accessed. So port forwarding cannot be an option I guess??
ogzylz
@ogzylz, the simplest way is to allow direct access to your server1 or having your applet accessible from server2 only.
Colin Hebert
But both of them is not possible unfortunately.. I just need another soln'..
ogzylz
A: 

If you can not connect to a spesific port on a server, its possibly related to firewall.

As I know, Linux firewall doesnt allows outer connections to ports, if they are not defined as "allowed", in iptables.

You should modify iptables to connect to proper port.
More on iptables.

feridcelik
that makes sense but unfortunately I am not a sudo doer. So I cannot check whether it is allowed or not but thanks anyway..
ogzylz
do you know any port(s) that is always available so that I can use them?? I was using 42420th port ..
ogzylz
@ogzylz any port over 1024 shouldn't ask you SU powers.
Colin Hebert
@Colin Hebert SU powers? - you mean sudo power??
ogzylz
@ogzylz, yes, sudo just means "SU do" which means "Super User do"
Colin Hebert
thank 4 the info. I did not know that :) I got this : "iptables -A INPUT -p tcp --dport 42365 -j ACCEPT" and the result :"iptables v1.3.3: can't initialize iptables table `filter': Permission denied (you must be root)"Perhaps iptables or your kernel needs to be upgraded.
ogzylz