Need Advice in SSH

Rob stopspam at users.sourceforge.net
Sun May 9 08:16:02 PDT 2004


Bull TORS wrote:
> Hello,
> 
> I was hoping if anyway could give me advice, hints, and anything about this 
> question of mine.
> 
> 
> laptop1.mydomain.org		<-----?ssh?--->		laptop2.mydomain.org
> Static IP Address from the 					DHCP client of my ISP
> Company LAN Server with
> a different domain (companydomain.org)
> 

You've triggered my curiosity and I've tried a bit myself with ssh.
I've come a little further. Imagine this network setup:


PC1 ------ Gateway -----//-----PC2

PC1: 10.0.0.N on a local network
PC2: has world-wide IP address, say: x.y.z

Then you can do on PC1:

    ssh -N -f -R 2200:localhost:22 x.y.z

which will create an ssh-tunnel from PC1 to PC2 as a background process,
and will force PC2 to listen on port 2200, which will be connected to
port 22 on PC1.

After establishing this tunnel, you can do on PC2:

   ssh -p 2200 localhost

and you connect directly to PC1.

In this process, you do not need any login/password on the gateway!!

Exchanging public keys of the two PCs, will skip the password checking.
You also can add lines in ~/.ssh/config, to shorten the last command.

I know in your case, both PCs are on a local network and there are two
gateways inbetween. So this is not the final solution to your problem,
but it may help you understand what way to go with ssh.
I remember you had login/password of one gateway, which certainly may
make things easier.

I hope all this helps a bit.

Rob.




More information about the freebsd-questions mailing list