What us the best way to add remote access to my servers?
from ZeDoTelhado@lemmy.world to selfhosted@lemmy.world on 02 Mar 09:43
https://lemmy.world/post/43757826

Hi,

I an currently trying to add remote access to 2 of my servers but didn’t manage to get a working setup as is.

Right now I want to access 2 servers:

I was trying at some point to add stuff such as tailscale, but somehow I always had issues with having both servers reachable within the IP range I use on my local network, so everything would work as is with the current config at home being away. I have also heard of cloudflare tunnels as well, but that I didn’t try yet. At some point I tried to do just a regular wireguard from my opnsense, but I would prefer not to have open ports to worry about (and also had issues with internal IP not being assigned from wireguard as well).

Does anyone here has experience with this? If so, what was your solution and/or caviats to it?

EDIT: I got some very good responses but I think I failed to understand that what I would need is probably a hop in server of sorts for the VPN. Meaning:

Does anyone has experience with such solution? My point would be able to have full access to everything on the network without having to do a VPN on every machine i need access to (although it can create a massive single point of failure/risk)

#selfhosted

threaded - newest

neon_nova@lemmy.dbzer0.com on 02 Mar 09:45 next collapse

I was going to say Tailscale. You will need to give more details about what didn’t work with Tailscale, but it has been pretty seamless for me.

ZeDoTelhado@lemmy.world on 02 Mar 09:52 next collapse

Basically when I connect to tailscale I just can’t get it to give an internal IP so I can access everything with my configs. Unless I am missing something obvious, I don’t understand what is going on here.

MaggiWuerze@feddit.org on 02 Mar 09:53 next collapse

Sure, you’re not behind CGNAT?

ZeDoTelhado@lemmy.world on 02 Mar 09:59 collapse

I do not have Nat of any kind that I am aware

rtxn@lemmy.world on 02 Mar 11:01 collapse

If you have IPv4 addresses, I guarantee you’re behind at least one NAT gateway. What you need is a Tailscale subnet router, or something equivalent from another service.

In the most basic configuration, the Tailscale client facilitates communication (by using some UDP black magic fuckery) between one host it is running on and another host it is running on that are both connected to the same tailnet (the virtual network between Tailscale hosts). For this purpose, it uses addresses from the 100.64.0.0/10 “shared address space” subnet. These addresses will only be reachable from within your tailnet.

If you want an entire subnet (e.g. your LAN) to be accessible within your tailnet, you need to set up a subnet router. This involves configuring the Tailscale client on a device within the target subnet to advertise routes (tailscale set --advertise-routes=192.168.1.0/24), allowing the host to advertise routes in the admin page (Machines -> -> Edit routes), and configuring the Tailscale client on external hosts to accept advertised routes (tailscale set --accept-routes).

If you want your servers to be accessible from anywhere on the internet, you’ll need Tailscale Funnel. I don’t use it personally, but it seems to work. Make sure you understand the risks and challenges involved with exposing a service to the public if you want to choose this route.

ZeDoTelhado@lemmy.world on 02 Mar 11:23 collapse

Ah great, this sounds like what I was missing with tailscale. With try once I can, thanks!

neon_nova@lemmy.dbzer0.com on 02 Mar 09:55 collapse

When you connect to Tailscale, via cli it should give you a link to use to connect it to your account. You can get the ip address in various ways. One of which is just looking on your Tailscale dashboard. You need to have Tailscale installed on every machine you want to talk with.

mrnobody@reddthat.com on 02 Mar 14:54 collapse

How did you config tail scale though? Are you using some Apple or MS author account? I want to stay away with using one of their services to “authorize” connecting to my own server

Dojan@pawb.social on 02 Mar 09:55 next collapse

I recently switched from tailscale to NetBird. Similar solution but FOSS and self-hostable.

Have you exposed the subnet the services are on, onto the Tailscale network?

ZeDoTelhado@lemmy.world on 02 Mar 10:18 next collapse

I think I did set this option, but still no internal IP. Can try again later to be sure

[deleted] on 02 Mar 12:11 collapse

.

0x0@lemmy.zip on 02 Mar 17:44 collapse

Did you consider Headscale? What made you chose NetBird?

Dojan@pawb.social on 02 Mar 17:51 collapse

Nope.

NetBird is European. The stack itself is FOSS and self-hostable instead of relying on third party projects, like Headscale. It has a reverse-proxy feature in beta that was also appealing.

NetBird also utilises Coturn for STUN and TURN, and I’ve other software that depends on Coturn, so that kind of went hand-in-hand.

0x0@lemmy.zip on 02 Mar 22:24 collapse

Noted, moved to the top of the which VPN-ish tool to use soon stack.

Decronym@lemmy.decronym.xyz on 02 Mar 10:00 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
CGNAT Carrier-Grade NAT
DNS Domain Name Service/System
IP Internet Protocol
NAT Network Address Translation
SSH Secure Shell for remote terminal access
SSO Single Sign-On
UDP User Datagram Protocol, for real-time communications
VNC Virtual Network Computing for remote desktop access
VPN Virtual Private Network

[Thread #127 for this comm, first seen 2nd Mar 2026, 10:00] [FAQ] [Full list] [Contact] [Source code]

captcha_incorrect@lemmy.world on 02 Mar 10:03 next collapse

Do you want to expose port 80/443 and set up a reverse proxy or do you want to use a VPN tunnel? You could just use SSH to port 80 and 443 like so: ssh -L 80:<local-server-ip>:80 -L 443:<local-server-ip>:443 <username>@<domain>

I expose port 80/443 and use Caddy as a reverse proxy together with Authelia to protect anything that I deem needs an extra layer of security. I followed this guide: caddy.community/t/…/20465

Once setup, it is easy to remove or add a backend to Caddy and Authelia. This way does mean that you sometimes need to log in twice, but that is a small price to pay if your backend app does not support SSO (like n8n community edition).

hendrik@palaver.p3x.de on 02 Mar 10:21 next collapse

For remote management, I just enable SSH, configure it to run on some non-standard port and enable Fail2ban… Make sure I use certificates or secure passwords and also check if fail2ban is actually doing its job. Never had any issues with that setup.

For the services I’ll either use a reverse proxy, plus configure the applications not to allow infinite login attempts, or Wireguard / a VPN.

ergonomic_importer@piefed.ca on 02 Mar 15:14 collapse

For remote management, I just enable SSH, configure it to run on some non-standard port and enable Fail2ban… Make sure I use certificates or secure passwords and also check if fail2ban is actually doing its job. Never had any issues with that setup.

This is what I’ve done for years, but I sometimes feel like it’s not a great solution from a security standpoint.
Though I have switched from fail2ban to Crowdsec, which did end up banning my own connection attempts when I forgot to whitelist myself, so that seems secure enough.

hendrik@palaver.p3x.de on 02 Mar 16:15 collapse

Hmmh. I’m not entirely satisfied with any of them. Crowdsec is a bit too complex and involved for my taste. And oftentimes there’s no good application config floating around on the internet, neither do I get any sane defaults from my Linux distribution. Whereas fail2ban is old and eats up way too much resources for what it’s doing. And all of it is a bit too error-prone(?) As far as I remember I had several instances when I thought I had set it up correctly, but it didn’t match anything. Or it was looking for some logfile per default but my program wrote to the SystemD journal. So nowadays, I’ll double-check everything. I wish programs like sshd and webapps came with that kind of security built in in some foolproof way.

nykula@piefed.social on 02 Mar 10:31 next collapse

Have you tried adding Tor hidden services? It was the easiest solution for me to expose ports from behind the provider’s NAT to my phone when not at home.

ZeDoTelhado@lemmy.world on 02 Mar 11:37 collapse

Never tried hidden services from tor. Can check how that works but not sure if it is the solution I am looking for. Thanks for the info anyways!

h_ramus@piefed.social on 02 Mar 11:02 next collapse

I’m behind CGNAT. My OpenWrt router is a Netbird server that can be connected externally. Having the Netbird server in the router allows me to ssh devices or use services as if I was connected via WiFi.

There’s documentation for Opnsense as well -(https://docs.opnsense.org/manual/how-tos/netbird.html)

ZeDoTelhado@lemmy.world on 02 Mar 11:22 collapse

I will check if this can work for me, but sounds like it is the kind of solution I am looking for

h_ramus@piefed.social on 02 Mar 12:12 collapse

After everything is setup, create a network route to distribute an ip to machines connected to you lan. I can’t recall exactly but setting up Netbird was pretty straightforward when following the documentation. They also have their own for Opnsense - (https://docs.netbird.io/get-started/install/opnsense)

Managed Networks documentation

prenatal_confusion@feddit.org on 02 Mar 11:10 next collapse

I switched from tail scale to pangolin for reverse proxy. Does everything. Auth, VPN, hidden services, public services. Fantastic piece of software

GreenKnight23@lemmy.world on 02 Mar 11:57 next collapse

“how do I add remote access to my servers?”

don’t.

create a new server that’s accessible via VPN and then access your servers from there. then actively log all connections from that device and alert anytime someone or something connects to it.

what is more secure? a house with twenty front doors or a house with one front door and an alarm on it.

ZeDoTelhado@lemmy.world on 02 Mar 12:09 collapse

If you check my edit that is kind of what I was hoping to do from the start: have a hop server (or stepping stone, both terms apply), and from there I do what I need to do

sj_zero@lotide.fbxl.net on 02 Mar 12:04 next collapse

Apache guacamole is something I wish I had when I started. Let's you connect with telnet, ssh, RDP, or VNC using html5

ZeDoTelhado@lemmy.world on 02 Mar 12:10 collapse

Never heard of this one, will check once I can

StrawberryPigtails@lemmy.sdf.org on 02 Mar 12:09 next collapse

The way Tailscale works, you don’t need to worry to much about your local IP address. You can just use the Tailscale IP address and it will connect as if you were local using the fastest route. That’s the beauty of a mesh VPN. Each device knows the fastest route to each other.

Without more information I can’t really tell what issue you are actually having, but if your system has internet, you have a local IP and if the system is showing as up on your tailscale dashboard than it will have a tailscale IP. Not being able to connect using one or the other would be a configuration issue. Whatever service you are having trouble with is probably only listening to one of the interfaces but not the other.

I’m assuming you are running a linux or unix box, but try running the command ip addr. Assuming you have the package installed, it will tell you all of your IP addresses for the system you run the command on. The list may be quite long if you have a lot of docker containers running. The command tailscale ip will do the same but limited to your tailscale IP addresses.

mrnobody@reddthat.com on 02 Mar 14:54 collapse

How did you config tail scale though? Are you using some Apple or MS author account? I want to stay away with using one of their services to “authorize” connecting to my own server

StrawberryPigtails@lemmy.sdf.org on 02 Mar 15:48 collapse

Are you using some Apple or MS author account?

Google and Github SSO were the only options when I originally setup tailscale. There are a few more options now including what looks like every self-hosted OIDC provider I’ve ever heard of, and a few I hadn’t.

How did you config tail scale though?

There are a couple options depending on how you are using it. Most of the time I just use the tailscale command to configure each node.

Most systems were just sudo tailscale up --ssh to get it up and running, although I have one system setup as a subnet router to give me outside-the-house access to systems that I can’t put tailscale on. That was a little more involved but it was still pretty straightforward and well documented. Their documentation is actually very well written and is worth the read.

pHr34kY@lemmy.world on 02 Mar 12:40 next collapse

Just expose it on single-stack IPv6. Nobody ever knocks. The address space is not scannable.

Paragone@lemmy.world on 02 Mar 15:48 next collapse

Give it a robot that can read your handwriting, & write snail-mail lettres to it?

d :

_ /\ _

[deleted] on 02 Mar 16:59 next collapse

.

spaghettiwestern@sh.itjust.works on 02 Mar 16:59 next collapse

I think you’re overthinking it. Wireguard is considered the “gold standard” and an excellent solution for what you’re trying to do. Open ports can be a concern, but an open Wireguard port is completely silent when not in use and does not respond unless it receives the correct access keys. That makes it invisible to port scanners.

Wireguard on my OpenWRT router works flawlessly. If the router is working the WG endpoint is too, and there are no 3rd parties involved. Tailscale provides much the same thing, but as I understand it requires the involvement of multiple 3rd party services. I’ve been burned too many times by terms of service changes and security breaches so I wanted to avoid relying on any corporate entities wherever possible.

Tasker brings up the tunnel on my phone automatically whenever I’m not connected to my home wifi and drops it when I get back home, so my home servers are always available. My biggest problem when not at home is Verizon’s crappy mobile network.

IMO it’s worth the effort to properly configure Wireguard and get your servers working. Once you get it set up you probably won’t have to touch it for years.

ZeDoTelhado@lemmy.world on 02 Mar 18:26 collapse

I get what you’re saying, but how exactly the whole IP rotation is done in your case? How did you manage to have it accessible at all times even when your home IP changes? In my home I actually have ipv6 which I am not sure if it does not make things more difficult

spaghettiwestern@sh.itjust.works on 02 Mar 18:54 collapse

DDNS (Dynamic DNS), one 3rd party service I do use.

My network is reached by URL, not IP (although IP still works). When my IP changes the router updates the DDNS service in minutes. Lots of providers out there and it’s easy to switch if needed. I like DuckDNS. It’s free or you can choose to donate a bit to cover their expenses.

ZeDoTelhado@lemmy.world on 02 Mar 18:56 collapse

Can also check one more time wireguard directly. Thanks!

Atlas_@lemmy.world on 02 Mar 18:44 collapse

If the servers have public IPs and you want the minimum possible ports open, just SSH? With passwords disabled and large keys, it’s quite secure.

If that’s still not enough for you or you need a private gateway, then Wireguard. I can strongly recommend Tailscale - It’s really an orchestration layer on top of Wireguard. You can setup your own Derp relays and head scale if you are truly paranoid. But 99.9% you don’t need all that and Tailscale out of the box will work well.

Also Tailscale isn’t a single point of failure the way you’re imagining. It’s certainly possible for Tailscale’s servers to go down, but that won’t drop existing connections.