Re: ssh -L syntax question

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

 



grandsatrap wrote:
What is the difference between ssh -L 2000:localhost:5900 frank@xxxxxxxxxxxxx
This one will forward local connections to port 2000, by connecting them to 127.0.0.1:5900 from server.me.org
and ssh -L 2000:server.me.org:5900 frank@xxxxxxxxxxxxx ?
This one will forward local connections to port 2000, by connecting to the IP address that "server.me.org" resolves to, at port 5900 from server.me.org.

I am not sure, but I think that the lookup is done from server.me.org, rather than your "local" machine. It will probably look in /etc/hosts first, and then ask via DNS.

The distinction here is important, as 127.0.0.1 is (almost) always assigned to the lo0 interface, whereas the IP returned from resolving "server.me.org" will most likely be assigned to the same network interface that you are connecting on. So, for instance, you could set your VNC server to only listen for incoming connections on port 127.0.0.1, for a more "secure" approach using ssh in this fashion. Otherwise, you have to make sure that your firewall blocks incoming on port 5900.

--
Coleman

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

  Powered by Linux