Safest way would be Wireguard. If you don't have a static IP or domain, use an DDNS service like Duck DNS.
Self-Hosted Main
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
For Example
- Service: Dropbox - Alternative: Nextcloud
- Service: Google Reader - Alternative: Tiny Tiny RSS
- Service: Blogger - Alternative: WordPress
We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.
Useful Lists
- Awesome-Selfhosted List of Software
- Awesome-Sysadmin List of Software
Ssh with ed25519 pubkey access and password login disabled works fine for me. I have access from my phone via termux and any other terminal software.
As far as your changing ip goes, you could have a cron job that periodically checks your current IP and notifies you of changes over telegram or other method.
Best: Wireguard VPN, very easy to setup using PiVPN
Second best: DDNS with port forwarding and a strong password
Optional: Install XRDP for GUI and connect using Remote Desktop instead of SSH
I'm currently using cloudflare tunnel. It works with ssh but you have to have cloudflare cli on the client. Please note that I'm a complete noob and this probably isn't the best solution.
Tailscale 👍👍👍
Install Tailscale on your Pi and on any other device you want to access it from. It’s super straightforward and you should be able to connect the two devices without opening any ports instantly.
Safest and fast - Wireguard. But you need to setup duckdns too.
Safest and easiest - Tailscale. It's a userland implementation of Wireguard with added stuff to make it stupidly easy to run. But because it's not a kernel module, it's slightly slower.
Free, foolproof, safe and quick way to do it is Tailscale.