ewx: (geek)
[personal profile] ewx

I want access from my laptop to various services (web proxy and email) on my home network, even when I’m away. A convenient way to do this is to use SSH port forwarding. This is a nuisance to repeatedly initiate manually though; I would rather have my laptop run the SSH command automatically, and restart it after network outages.

How I set it up for Ubuntu, Mac and Windows laptops )

(no subject)

Date: 2010-05-03 07:32 pm (UTC)
pm215: (Default)
From: [personal profile] pm215
while :; do
  echo
  sleep 60
done
...clearly yes(1) needs a --delay option :-)

(no subject)

Date: 2010-05-25 07:42 pm (UTC)
From: [identity profile] mdw [distorted.org.uk] (from livejournal.com)
What's the advantage of your `idle' script over setting /bin/false as the command in authorized_keys and insisting that clients invoke ssh -N (PuTTY `Don't start a shell or command at all')?

I'd also recommend
    cond=true; while $cond; do cond="sleep 1"; ssh tunnels -N; done
, 'cos that way interrupting sleep stops the loop, even if you
don't set -e.

Finally, if there's some hook for scripts to be called when the network
connection changes, it might be worth using OpenSSH's master mode: then ssh tunnel -Oexit when it needs to be kicked. Your shell loop will then reopen the connection. (This will kill all the forwarded connections, but they were toast anyway.) You'll need to add `ControlPath something' to the .ssh/config stanza to make this work. I don't think PuTTY has anything similar.

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags