Live data from Hacker News

Putting Raspberry Pi Online with Caddy and SSH Tunnel

gist.github.com

111–120 of 157 posts

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#111
post #10

Earlier quoted context omitted.

Privacy; keep data local, without exposing your residential IP.

Is exposing one's residential IP address such a bad thing? Is the threat model just that someone might wish to target you individually, and that they'll have better luck finding a vuln into your LAN if your services are listening directly on public ports?

There are unlimited imaginable reasons why one may want to de-correlate the data sent in or out from ones software to ones personal identity, yes.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#112
> I set GatewayPorts clientspecified in my /etc/ssh/sshd_config on the server. This is needed so that the client (RaspberryPi) can specify which ports to enabled reverse tunneling on.

This isn't quite what GatewayPorts does. By default, the client can open a tunnel to any ports the user has access to, but those ports can only be connected to from localhost on the server. So even if you don't have a firewall, external IPs can't connect to your tunnel (but your reverse proxy can, if it's running on the same machine). You can use GatewayPorts to allow binding from other IPs. This is useful if you want to tunnel arbitrary TCP traffic, not just HTTP through your reverse proxy.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#113

I wish we were a little farther along so I'd have more to say, but we're hoping to solve this with https://hoppy.network/ . It's nothing you couldn't do yourself, but we host it for you so you don't have to. We host WireGuard servers which assign a stable public IPv4 and IPv6 on your device's WireGuard tunnel interface. As far as your device is concerned, it's like its tunnel interface is a publicly addressable conne…

I like it. Forwarding public ips through WireGuard is a nice level of abstraction. I maintain a list of tunneling solutions here: https://github.com/anderspitman/awesome-tunneling Happy to add hoppy if you think you're a good fit and submit a PR. A couple questions: * Do you provide any sort of reverse proxy service, ie HTTPS termination with Let's Encrypt support, similar to OP? * Do you provide any DNS integration…

Yes, we provide reverse DNS for the IPv4 through the management interface.

A subdomain (*.hoppy.link) for the tunnelled IP address provided can be created if you send us a support email.

We do not provide any reverse proxy, but it could be a possibility if there is demand.

Tailscale uses the non-routable IP space, and is strictly for private networks, and cannot publish to public networks.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#115

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 ser…

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.

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

#116
post #80

Earlier quoted context omitted.

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.

zerotier is nice, but I have migrated to tailscale. Its based on wireguard and seems even better performance wise.

> 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

#117

Up until about 2 years ago, I used to use the same method as you've listed! Actually, I still use this method, but do it a bit differently. I have a ZeroTier network setup to connect a VM and RPI for internal communication, then I use nginx with the stream module [1] in order to do SNI proxying down to the RPI from the VM over the internal ZT network. Why use the stream module vs the normal proxy module you might ask…

I do want to mention that of all the 30+ options I've researched, sish looks like one of the best. Even though in the end I decided to implement my own[0].

[0]: https://xkcd.com/927/

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#118
post #114

A comparison of the security of these several approaches would be helpful. Am I correct that Wireguard and SSH are the more secure options?

I would personally trust SSH based on OpenSSH the most, WireGuard second, custom SSH third, TLS 4th, and then the rest.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#119
post #47

I don't get it, I may be missing some context thought: why the author didn't go for running said webapps directly on the VPS in the first place? Why bother running it on the Pi and set up the tunnel (which is a nice hack in itself, I get that)?

For me it's primarily 2 things:

1. I have much better hardware in my house than any VPS can offer at a competitive price. This is particularly important for storage. Object storage like S3 is relatively cheap, but I just want a file system I can slap a static server (or whatever else I want) in front of. If you go for full block storage the price is way higher, and performance still isn't as good as a local SSD.

2. I hope the future of the internet involves more people self hosting over IPv6. I see tunneling solutions as an intermediate step to that world. If we make it easy for people to self host, it might even be able to help drive IPv6 adoption.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#120
post #101

At this point you are pretty close to just being able to use your VPS for whatever you wanted to do access remotely. I have tried a ssh port forward solution earlier, but the connection fell down, did not always come up after boot and was generally unreliable. I found wireguard to be much easier to set up and highly reliable. It's in my own opinion not that hard to set up either, there are plenty of guides. The wireg…

> I have tried a ssh port forward solution earlier, but the connection fell down, did not always come up after boot and was generally unreliable.

WireGuard is a great solution, but I have heard people speak highly of autossh, which I believe may solve this.

Post reply on HN