firewall rule to let ssh access the server??

firewall rule to let ssh access the server??

Post by Dan Man » Sun, 15 Jul 2001 03:48:40



HI.... still have problem to connect to my computer remotly with ssh...

SSH connection to my computer is not possible when the firewall is up.

The rules are simple as it can be: ouput and forward chain are set to
accept all. And here is the input one:

iptables -A INPUT -i $IFACE -p tcp --dport 22 -m state --state
NEW,ESTABLISHED -j ACCEPT

iptables -A INPUT -i $IFACE -p tcp --sport 22  -j ACCEPT

Does anyone have an idea about the reason the connection is blocked by
the firewall...?

Thanks...

 
 
 

firewall rule to let ssh access the server??

Post by lbudney-use.. » Sun, 15 Jul 2001 06:33:40



> HI.... still have problem to connect to my computer remotly with ssh...

> iptables -A INPUT -i $IFACE -p tcp --dport 22 -m state --state
> NEW,ESTABLISHED -j ACCEPT

> iptables -A INPUT -i $IFACE -p tcp --sport 22  -j ACCEPT

Shouldn't INPUT be OUTPUT in your second rule?

--Len.

--
I was the villain?  Well corn my pone.
                                -- Phrack Magazine

 
 
 

firewall rule to let ssh access the server??

Post by Norm » Sun, 15 Jul 2001 14:28:33



> HI.... still have problem to connect to my computer remotly with ssh...

> SSH connection to my computer is not possible when the firewall is up.

> The rules are simple as it can be: ouput and forward chain are set to
> accept all. And here is the input one:

> iptables -A INPUT -i $IFACE -p tcp --dport 22 -m state --state
> NEW,ESTABLISHED -j ACCEPT

> iptables -A INPUT -i $IFACE -p tcp --sport 22  -j ACCEPT

> Does anyone have an idea about the reason the connection is blocked by
> the firewall...?

> Thanks...

You also need a -o on the interface for the OUTPUT rule.

Your welcome,

Norm.
--
I have watched kids testifying before Congress. It is clear that they
are completely unaware of the seriousness of their acts. There is
obviously a cultural gap. The act of breaking into a computer system
has to have the same social stigma as breaking into a neighbor's house.
It should not matter that the neighbor's door is unlocked. The press
must learn that misguided use of a computer is no more amazing than
drunk driving of an automobile.

Ken Thompson Sept. 1995 ACM



 
 
 

firewall rule to let ssh access the server??

Post by Andreas » Sun, 15 Jul 2001 18:20:45


Hmmm.

Quote:> iptables -A INPUT -i $IFACE -p tcp --dport 22 -m state --state
> NEW,ESTABLISHED -j ACCEPT

Is there a special reason you r using "-m state"? I didn't know the command till yet. I just let
port 22 open at all. (--dport 22 -j ACCEPT) and it works just fine. I don't think, that it really
makes sense to give the "-m" option here at all.

greets

 
 
 

firewall rule to let ssh access the server??

Post by Dan Man » Tue, 17 Jul 2001 22:21:50


I've already tried iptables -A -i $INPUT -p tcp --dport 22 -j ACCEPT
iptables -A -i $INPUT -p tcp --sport 22 -j ACCEPT
...but the result was the same. And the OUTPUT chain is set to ACCEPT
everything... so the proble is not there i think.

Thanks anyway for all your suggestions..

 
 
 

firewall rule to let ssh access the server??

Post by lbudney-use.. » Thu, 19 Jul 2001 00:02:49



> Thanks anyway for all your suggestions..

It would help if you'd actually tell us a little more. Are those three rules
*all* of your firewall rules? SSH connects from privileged ports between
512 and 1024, so if you are blocking privileged ports by a prior rule, that
would do it.

--Len.

--
When you talk about every use of a person's name as ``ad hominem''
you simply make yourself sound illiterate.
                                -- Dan Bernstein

 
 
 

1. Getting around corporate firewalls to access ssh server

I have an ssh server which I use to distribute code to my customers. I
have the port set to a number in the 2000s rather than the standard port
22.

My problem is that I have several customers at large corporations which
have firewalls that block outgoing access to my machine. Is anything there
I can do to make it possible for them the access my machine, moving to
another port. Is there anything that they can do? I'm open to suggestions?

Thanks,

2. Java interpreters for Linux

3. "simple" firewall rules wont let dns out..

4. lilo: linux, dos622, win95

5. SSH Through a firewall to gain access to a firewalled network

6. 1.2.8 Generic SCSI help

7. Firewall rules problem for ssh

8. Where can I find a complete manual for C/C++ under unix?

9. firewall rules problem for ssh...

10. Firewall rules problems for ssh

11. trying to reload firewall rules through ssh and from remote box

12. automate file access on server using SSH and passwordless access

13. Public SSH server / unix server with SSH available