forwarding ssh requests

Thomas Cameron plug-discuss@lists.plug.phoenix.az.us
Tue, 20 May 2003 14:06:40 -0500


That's what I was going to answer, but I am not getting it to work...

[root@mailtest1 root]# iptables -t nat -A PREROUTING -p tcp -d
127.0.0.1 --dport 3022 -j DNAT --to-destination 127.0.0.1:22
[root@mailtest1 root]# ssh 127.0.0.1 -p 3022
ssh: connect to host 127.0.0.1 port 3022: Connection refused

I have tried to DNAT to a local address as well as another address with the
same results.

What gives?
TC

----- Original Message ----- 
From: "David A. Sinck" <plug-discuss@grueslayer.com>
To: <plug-discuss@lists.plug.phoenix.az.us>
Sent: Tuesday, May 20, 2003 1:35 PM
Subject: forwarding ssh requests


>
>
> \_ SMTP quoth Liberty Young on 5/20/2003 11:27 as having spake thusly:
> \_
> \_
> \_
> \_ I'm trying to forward ssh requests from one machine to another  from
the
> \_ internet.
> \_
> \_ i.e., ssh to my home gateway from work on port 22 does just that (this
> \_ works already).
> \_ but if i ssh to my home gateway's IP from work, on port 3022 for
> \_ example, would actually be logging me into another box behind my
> \_ gateway.
> \_
> \_ I've been googling for iptable rules for this, but i'm not finding one.
> \_ Do you guys have any iptable examples or other suggestions?
>
> /sbin/iptables -t nat  -A PREROUTING -p tcp -m tcp --dport 3022 \
>                        -j DNAT --to-destination 192.168.0.10:22
>
>
> David
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>