> Can you possibly give a detailed description or example because I am quite
> ignorant of exactly what happens in port forwarding.

Certainly.

I connect my machine at home to a gateway box that's running sshd.
There's a firewall that keeps all other traffic out. The gateway
box is sitting on the same network at my mail server at work.

Sendmail sits on port 25 of my mail server at work.
Imapd sits on port 143.

At home, I configure ssh to port-forward port 25 on my box at
work to port 4025 on my machine at home. I also port-forward
port 143 on my box at work to 4143 at home.

Once I establish my connection to the gateway, the port-forward
setup is started.

I set up my mail client at home to connect to port 4143 on 
localhost. I also set it to send mail through the SMTP connection 
on port 4025 on localhost. I still have to give the client the 
usual userid and password information as if I were connecting to 
that server at work.

With this setup, I can read my mail on my imap server at work
securely (and compressed), and when I send mail, as far as the
machine at work is concerned, it came from inside the network.

Behind the scenes what really is happening is that ssh is 
receiving a packet at the port on localhost. It rewrites
that packet and sends it to the ssh daemon on the gateway.
The sshd daemon rewrites the packet again and sends it to
my mail server at work. The reply is rewritten the same way.
As far as the mail client and mail server are concerned,
the connection is local and they are unaware of the steps
in between.

That's the main utility of the system. I don't have to change
the programs I use to get a secure connection.

--jrp


Reply via email to