Re: Configuration dependent on local hostname?
- From: Josef Wolf <jw@xxxxxxxxxxxxx>
- Date: Tue, 24 Mar 2009 22:29:39 +0100
On Tue, Mar 24, 2009 at 02:40:52PM +1100, Darren Tucker wrote:
To get access to hosts behind a NAT-router, I have put the following
into my ssh-config:
[ ... ]
You can do this entirely with a little proxycommand. For example, I have
something like this:
in ~/.ssh/config:
Host myinternalhost
ProxyCommand ~/bin/myconnect %h %p
in ~/bin/myconnect:
#!/bin/sh
if ifconfig fxp0 | grep "inet 10\.0\.0\." >/dev/null; then
exec nc $1 $2 # internal, connect direct
fi
exec gw.my.do.main ssh nc $1 $2 # external, via GW
[ ... ]
Ah, that looks very promising. Thanks Darren! I'll try that.
- References:
- Configuration dependent on local hostname?
- From: Josef Wolf
- Re: Configuration dependent on local hostname?
- From: Darren Tucker
- Configuration dependent on local hostname?
- Prev by Date: Re: Can ssh add keys to ssh-agent?
- Next by Date: using sftpfilecontrol /umask
- Previous by thread: Re: Configuration dependent on local hostname?
- Next by thread: using sftpfilecontrol /umask
- Index(es):