-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi folks, I'm in need of some wizardry. I have a machine at home that's connected to the telly so that the wife can use it for Skype (just bought a *really* nice HD webcam) and browsing etc (and I can use it for Steam ;) What I need is for it to ssh to my server when it boots and open a port there to its local sshd so that I can ssh into it whenever I need. I'm on an ISP that will change my IP address every now and then and I don't want to muck about with dyndns etc. so this is my preferred solution. I know how to do the ssh bit: ssh -R 2222:localhost:22 server What I don't know is how to make it do that when it boots - obviously when the wifi gets around to connecting - and to make it resilient to drop outs, i.e. reconnect if the connection is lost. Any ideas? Cheers, Steve -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBCAAGBQJTIZ0zAAoJEL/3HArzwYbRO0sP/0mLMg8Btmy9TLevSppXGu+/ E/vfabP/p7iaembSOOXR4NkKiyvoUb6YHk8a7Az2sL4MxNY3VWz1H/lLDhlbPbsR YI2SECYnSmDnxdWa8sk4TfYfhnnkRAZF3nXz2EiQt72M0Jqnz/5cL/bVKqBjDsJ9 te5H4O0kX3/6S2Sl7DMXsBPGbxGD6nheXqJNB4UDQBVxgxc6bPVqOFOmAMbJHovF dDugXdEsDZp5D5gDcExozMELhWE8mhVmSP7QXrV1a4tWHTlRrTfu8eFGNCSawDhB e9tgFPoJ/Rrg4hxsY8hT7LozzzQ3K+E1QEbt1avfrqkv3VGmfVTOpFwMVoNuSRtl zgozPZb+hcYJPiWRwtY5qqcpqFSrevv47sq9f2a4Q9NYR2dwnSNnAStNcdxaRexi T4yZa/rYp7FmPJwRV/zjLudrX8g+W61BxhvQxqnIbulcuyYDLY4EkjIbbYnnFOey JHCvWZxQau4SRZsuQA4iYkI8ptHBocRgGyPu2pFFIzFiBmtsZguRAynaQspr+/Vj D2j3ZY1bHdZhHpcPDu6kSqI7wXk1n2PJUn16uLRsFVWf3ISafVzqWDh0LB0hc0Pm eqOypcYxYAJwpkMAdA9m/L6LsBSglYEoR8i5LkzO/8L5h9fIMYZmzugAlSnIHSz/ 9dLInArjhKVHDmckWuUF =n5Fx -----END PGP SIGNATURE-----
On Thu, 13 Mar 2014 11:57:39 +0000 Steve Engledow <steve@offend.me.uk> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Hi folks,
I'm in need of some wizardry.
I have a machine at home that's connected to the telly so that the wife can use it for Skype (just bought a *really* nice HD webcam) and browsing etc (and I can use it for Steam ;)
What I need is for it to ssh to my server when it boots and open a port there to its local sshd so that I can ssh into it whenever I need. I'm on an ISP that will change my IP address every now and then and I don't want to muck about with dyndns etc. so this is my preferred solution.
I know how to do the ssh bit: ssh -R 2222:localhost:22 server
What I don't know is how to make it do that when it boots - obviously when the wifi gets around to connecting - and to make it resilient to drop outs, i.e. reconnect if the connection is lost.
Any ideas?
As the resident numpty here, I would set the IP address of the tv machine on the router so that it gets the same IP address whenever it starts. So you wouldn't have to change anything on the machine, just the router. Tha's what I've done with my Pi (see my Owncloud question earlier) so that I can ssh into that on the same IP address. You said that your ISP will change your IP address but surely that's only internet facing address and not the internal one. Or is that not what you want to do?
On Thu, 13 Mar 2014 11:57:39 +0000 Steve Engledow <steve@offend.me.uk> allegedly wrote:
I have a machine at home that's connected to the telly so that the wife can use it for Skype (just bought a *really* nice HD webcam) and browsing etc (and I can use it for Steam ;)
Skype? *Skype*??? Oh well....
What I don't know is how to make it do that when it boots - obviously when the wifi gets around to connecting - and to make it resilient to drop outs, i.e. reconnect if the connection is lost.
You could setup a script in /etc/network/if-up.d to start the ssh process when TCP is up on an interface. And I think that autossh might help with the second problem (drops). Mick --------------------------------------------------------------------- Mick Morgan gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312 http://baldric.net ---------------------------------------------------------------------
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2014-03-13 12:30, mick wrote:
Skype? *Skype*??? Oh well....
I know. I've tried converting her family to other things but Skype is just so prevalent :(
And I think that autossh might help with the second problem (drops).
Yes indeed. In fact, shortly after I sent my mail I stumbled upon autossh. As an Arch user, I checked the arch wiki and there's a decent write up there including how to get it working in systemd which I've now done. https://wiki.archlinux.org/index.php/Secure_Shell#Autossh_-_automatically_re... Mission accomplished :) Steve -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBCAAGBQJTIbY6AAoJEL/3HArzwYbRss8P/2CjF8k5mZ+qufbfuSg7viuQ zTeDpRpld/SoHAjAFbJmz2Hs0WnENxn/zvtEfOlWbWZ7k2JmBM2QJSeVvLrkFJIi oYwZTZ5aXIU7w6eRUu+HzHdbECjrn/aIoERCtlM+ygp3YQm1UK+M4JM9CPXC7Ufo yL8NtZs6IIWCVIlDxNaa2vH6DIWOEoUEC+DkUS5V412ED/HP+O9RU77I4CHIBI3f APa2GzgQpxn1dNoQGKuovqtqdiHIZ5GnCMAoIwsP3rl/S8P8k38XyxAmSgpWZVNH End7GhF2Gzmt1Aq3CzjXOlMu0J4ZwToBsT/qahi5CFKQrls2U5al85IqtttEBXos cGY7/KZSvdVycM3gyLubRx4YsUqsqX0anl3kt8J6uFris3tEPvkylknoKBprZa7E 6dTX6HFpikzShmC5Ut8CByf7fxzGhYN15ans0LIkHPmpPnGuLPHe69zNPm3LXb56 PG2yxbjz7sm0+30LGbZ28ZnpGxEM87F/djmdQaXfB3KQza5/1WhKQKRHL8A023kB hfCyleP4IvbIhWqbGrcNnohKe2/WfObLo9VlbNmwCu/aSE7QzwaUxSqefsiUlRKj vS1JUIG5hP1mvjERxZPaHQoCM+kBTZsu79vj2qjl3DDkCpZpubyq4iSQzKYwgYky 4+wkEuM/q77lOcHDoCC6 =T77K -----END PGP SIGNATURE-----
On Thu, 13 Mar 2014 13:44:26 +0000 Steve Engledow <steve@offend.me.uk> allegedly wrote:
As an Arch user, I checked the arch wiki and there's a decent write up there including how to get it working in systemd which I've now done.
https://wiki.archlinux.org/index.php/Secure_Shell#Autossh_-_automatically_re...
That's good. I get more and more impressed by the Arch wiki every time I read something there. Even as a debian user I find it useful (and comprehensive). Mick --------------------------------------------------------------------- Mick Morgan gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312 http://baldric.net ---------------------------------------------------------------------
participants (3)
-
Chris Walker -
mick -
Steve Engledow