[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Remote SSH (dynamic IP) without third-party server



* On 2020 31 Jul 21:04 -0500, riveravaldez wrote:
> Is this possible?
> 
> Hi, to clarify: I would like to connect to a remote home-machine
> (dynamic IP) through SSH session but without using a third-party
> server (free or paid), just with software running in both machines.

Easy enough with SSH so long as the routable IP address of the target
machine is known.

> If so, would be possible to use a similar mechanism to obtain at any
> moment the counterpart's IP and then make a SSH login using such
> information?

This is where a dynamic DNS provider comes in as there needs to be some
way to discover the routable IP address of the target machine.

Years ago ISPs provided Web server space for personal home pages and
such, a practice that has largely stopped.  I started with writing a
script that scraped my router at the time for the routable IP address
and then uploaded it to my personal Web hosting.  As I knew the file
name I could grab it even though no one else would see it or know it was
there since the Web server sent the index.html file by default when
anyone tried to access the directory with http.  The file placed on the
Web host was a simple two liner with a date/time stamp and the IP
address.  I could then set my SSH alias to that IP address.  As the IP
address did not change often it was quite stable.

Changing to OpenWRT routers meant I lost the Web page to scrape.  I now
have a small PHP script on my Web host (now a paid hosting account
serving my domain) that returns the public IP address and the script
extracts it and updates the "hidden" file.

Now, even that is more or less out of date as since I set up a Freedom
Box, I am eligible for a no cost HOST.freedombox.rocks domain.  Now I
can just point my SSH alias to that (I use non-standard SSH ports and
port forwarding on my router to access a specific host on my LAN).  I
still have my script updating every hour "just in case".

All of these "solutions" require at least a third server which you're
trying to avoid.  Sorry.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819

Attachment: signature.asc
Description: PGP signature


Reply to: