Re: ssh -L syntax question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 13, 2008 at 02:29:16PM -0700, grandsatrap wrote:
> What is the difference between ssh -L 2000:localhost:5900 frank@xxxxxxxxxxxxx
> and 
> ssh -L 2000:server.me.org:5900 frank@xxxxxxxxxxxxx ?

In the first one, the sshd on server.me.org will make connections to
localhost:5900.  Assuming IPv4, this will make connections to 127.0.0.1
port 5900.

In the second one, the sshd on server.me.org makes connections to
server.me.org:5900.  If we suppose the IP address of server.me.org
is 192.168.1.5, this means sshd will make connections to 192.168.1.5
port 5900.

This matters if the service running on port 5900 is bound only to a
single interface (e.g. the loopback interface, 127.0.0.1) instead of
all interfaces.  If the service is only listening on loopback, then
the first one will reach it, but the second one will not.

It may also affect the source IP address seen by the service, which
could matter if you filter connections by source IP, or log the source
IPs, etc.

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux