News for hackers. Stuff that matters.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by nurettin on Monday October 26, 2020 @05:35AM (#24894315)
I install a reverse proxy on every remote machine (raspberry pi or odroid) I manage. These machines are usually tucked behind someone's router, and it is hard to tell every router owner to forward the ssh port. When I install a reverse proxy, the machines can proactively tunnel right into a beacon machine whenever they are online and I can ssh into them from the beacon machine directly. I usually set up frpc as a service on the remote machine. It is also possible to use autossh with a monitoring port for this, but I noticed that frpc can bypass firewall restrictions much easier. This scheme also lets me use tools like Cockpit to view the health and status of my remotes.

https://github.com/fatedier/frp

Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by viraptor on Monday October 26, 2020 @09:01AM (#24895680)
As an alternative, you could put it on a public mesh VPN. I use ZeroTier for that so I don't have to host an explicit beacon.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by narrationbox on Monday October 26, 2020 @02:37PM (#24899530)
At Narration Box we use Tailscale with Caddy's Cloudflare Let's Encrypt DNS-01 for internal DNS resolution + TLS for the apps that need it. In essence you get something like Google's internal "go/ links" except everything's hosted on the external DNS server and automatically protected by default by Tailscale since the IPs pointed to cannot be accessed publicly.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by athriren on Monday October 26, 2020 @05:21PM (#24901587)
if you guys do technical blog posts addressing aspects of your toolchain, i request one on this.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by narrationbox on Monday October 26, 2020 @06:23PM (#24902222)
You are not the first to ask :)

https://news.ycombinator.com/item?id=24436399

I will definitely do a writeup during/before the Christmas break.

Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by athriren on Wednesday October 28, 2020 @07:03AM (#24917384)
ha, thanks! i will look for it!
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by anderspitman on Monday October 26, 2020 @03:44PM (#24900423)
Does ZeroTier let you expose a specific machine publicly? ie if I have a raspberry pi behind a NAT, will ZeroTier provide me with a public IP anyone can use to connect to it?
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by viraptor on Monday October 26, 2020 @04:38PM (#24901103)
No, you still need to find a machine with a public IP. The usecase in parent comment mentioned only the SSH part, which is easier. But if you want to do forwarding from a specific machine to the public, you can do it manually.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by nurettin on Monday October 26, 2020 @09:10AM (#24895759)
This looks nice, Free tier even supports up to 50 devices.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by msh on Monday October 26, 2020 @10:18AM (#24896397)
zerotier is nice, but I have migrated to tailscale. Its based on wireguard and seems even better performance wise.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by anderspitman on Monday October 26, 2020 @03:46PM (#24900468)
> Its based on wireguard and seems even better performance wise.

I hadn't considered that, but it makes sense. Since ZeroTier is layer 2, I'd expect it to become a leaky abstraction (at least for performance) in certain cases where algorithms are expecting other layer 2 hardware to be essentially directly connected with a wire when in reality they're connected over the internet.

Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by viraptor on Monday October 26, 2020 @04:49PM (#24901222)
What algorithms you have in mind? That would be a bad assumption, since layer 2 can be ethernet, but it may be i2c, or slip, or spacewire... Layer 2 does not mean "close" or "fast".
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by johtso on Monday October 26, 2020 @10:57AM (#24896825)
Yeah, tailscale does look nice, only one user on the free tier was a deal-breaker for me though.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by tylerfontaine on Monday October 26, 2020 @10:25AM (#24896474)
I have started using Tailscale for this purpose. No beacon box required, super easy.

https://tailscale.com/

Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by xrendan on Monday October 26, 2020 @08:37AM (#24895456)
Oooh, thanks for this, I'm currently using the autossh route but have had some issues with it. frp looks like it could solve my problems :)
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by kzrdude on Monday October 26, 2020 @05:53AM (#24894388)
Just so that I understand the setup, this still requires one intermediate box - the beacon machine - to be running?
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by nurettin on Monday October 26, 2020 @06:08AM (#24894469)
It does require the beacon machine to be up, but the system easily recovers from a reboot of the beacon, since frpc will keep on trying to reconnect. It is a poor man's firewall-resilient one-way vpn.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by creztoe on Monday October 26, 2020 @06:04AM (#24894448)
That's how I understand it. Basically you have a machine hosted somewhere with a dedicated IP so you can access all remote machines from anywhere at any time, as long as they are connected to it via reverse proxy.
Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by wil421 on Monday October 26, 2020 @08:58AM (#24895650)
What are you using for your beacon machine?

Do you have a static IP or a domain that your beacon uses?

Re:Putting Raspberry Pi Online with Caddy and SSH Tunnel by nurettin on Monday October 26, 2020 @09:09AM (#24895741)
Sure, I just use the smallest size hetzner or DO available. I point its IP to a subdomain just like the article described.