Hi,

I have the usual VPN connection to my workplace, a simple "pon work" will
bring me up to the network.

Given that I leave my home machine connected to VPN 24/7, I'd like to
connect home from work using the VPN address, which is much faster.

Right now, in order to do this I have to "ssh <my no-ip address> ifconfig
ppp0" and then connect to the IP address I get there.

Instead, I'd like to update .ssh/config on my work machine to know that my
home machine is currently available at a particular VPN address.

I already have a script under /etc/ppp/ip-up.d at home which does some stuff
(e.g. setup additional routing rules) and this script has access to the just
assigned local address through the $PPP_LOCAL envariable.

But how can I copy this information over to my work machine in a useful
format?

The current solution I can think about is to setup a special ssh identity
which will have an unencrypted private key on home machine. Its public key
will only be limited to run a particular shell script on the work machine
which will read the given IP address and do something a-la "sed -e
's/@IP_ADDRESS@/$PPP_LOCAL/'
< .ssh/config_template > .ssh/config".

Is this the only way to do this? Is there a more elegant way I'm missing?

(We currently use MS VPN, maybe once I get around to switch to OpenVPN I'll
have more control over this and be able to dynamically assign host names
based on the user used to login to the VPN? Is this possible with MS VPN?)

Both work and home machines run Debian Etch ("Stable", at last :).

Thanks,

--Amos

Reply via email to