Remote into my home PC without opening router ports
More and more often I want to reach my main desktop at home from a laptop while I’m out, over Remote Desktop (RDP). The old-school way is to open a port on the router and expose RDP (port 3389) to the internet, but that’s a non-starter for security. An open port facing the internet becomes a brute-force target within hours.
On top of that, my apartment building shares one public IP address among units (carrier-grade NAT, or CGNAT). I assumed that without my own public IP, even dynamic DNS wouldn’t let me reach my router from outside. Building a dedicated VPN router or handing out certificates felt like too much, and I had half given up.
Short answer: Tailscale solved it. I used it to connect my home desktop and laptop securely, for free, without opening a single router port. Claude Code did most of the setup, but I checked the steps that needed admin rights and the decisions about what to trust myself. Here is the whole setup with a diagram of the layers, the actual settings screen and the commands I ran. You can follow it without Claude Code.
What Tailscale is
Tailscale, from Tailscale Inc. in the US, is a “mesh VPN” built on WireGuard, a well-proven encrypted VPN protocol. Running WireGuard yourself means generating and distributing keys per device, sorting out NAT traversal, and updating configs whenever devices come and go. Tailscale takes all of that off your hands.
The setup is simple: install the Tailscale app on each device and sign in with the same account. The devices automatically join an encrypted private network (Tailscale calls it a “tailnet”) and can talk directly as if they were on the same LAN. No router settings involved.
Tailscale’s coordination server keeps track of each device’s public key and the information needed for NAT traversal. That is only information about who can reach whom and how; the actual data, such as the remote screen or files, never passes through the coordination server. It goes peer to peer when devices can connect directly, or through a relay server (below) when they can’t.
The shared-IP problem didn’t matter either. When devices can’t connect directly (exactly my CGNAT situation), Tailscale automatically routes through its relay servers. No dynamic DNS, no port forwarding, no need to care what sits in front of your router. It works as is even if you share a public IP with your neighbors.
How it compares to similar tools
Similar tools include OpenVPN and ZeroTier. OpenVPN has you issue certificates and set up server-side routing yourself, and honestly few people pick it for a new VPN in 2026. ZeroTier works like a virtual LAN switch and is flexible, but uses its own protocol. Tailscale uses standard WireGuard, which makes the encryption easier to scrutinize, and goes all in on “zero config”. In practice, it has noticeably fewer settings than the others.
For personal use, the free Personal plan is plenty. No credit card required and no time limit (plans can change, so check the official pricing page). For a home server or connecting a few PCs, start with the free plan.
Three layers
The setup is three layers with different jobs. I kept them separate on purpose, so when something breaks it’s easy to tell which layer is at fault.
- Path: Tailscale. Direct device-to-device connection over WireGuard. No router ports opened, not even one. Since port 3389 never faces the internet, there’s nothing for brute-force attacks to hit. MagicDNS lets you reach devices by easy names instead of IP addresses
- Screen: Windows Remote Desktop. What you actually use to control the PC. This is the main goal, and the steps below aim to get this working first
- Terminal: OpenSSH Server (optional). Handy for command-line work but not required. Covered at the end
Tailscale only provides the path. The screen itself is plain Windows RDP. Think of Tailscale as laying one secure pipe.
The coordination server handles authentication and key exchange for both PCs, while the data flows through the encrypted WireGuard tunnel between the laptop and the desktop. The router has zero open ports (3389 and 22 are not exposed).
Setup (RDP)
1. Install Tailscale on both devices
Download the installer from the official site on both the desktop and the laptop, run it, and sign in with the same account (Google, Microsoft and so on). Hardly any configuration needed: a device joins the tailnet as soon as you sign in.
2. Turn on device approval
With “Device Approval” enabled in the Tailscale admin console, new devices need admin approval before they join the tailnet. I strongly recommend it as insurance in case your account itself gets taken over.

3. Enable RDP on the desktop
Turn it on under Settings → System → Remote Desktop. This needs Windows admin rights. Only Windows 11 Pro or higher can be an RDP host (the side being connected to); Home edition doesn’t have this setting at all. If your desktop runs Home, this method won’t work.
On the same screen, check under advanced settings that Network Level Authentication (NLA) is on. It should be by default. It requires authentication before a session starts, which shrinks the attack surface.
4. Disable key expiry on the desktop
By default Tailscale keys expire (180 days) and need re-authentication. On a laptop you carry, you just re-authenticate when it happens. But if it happens on the desktop sitting at home, you’re suddenly locked out while away. So in the Tailscale admin console (Machines tab), I opened the “…” menu on the desktop’s row and chose “Disable key expiry”.
That’s a trade-off. The device’s key then stays valid indefinitely. If the desktop were lost or compromised, it would stay valid until you revoke it manually. It’s acceptable for a machine that never leaves the house, not for a laptop you carry around.
Connecting over RDP
With that done, make sure Tailscale is running on the laptop and connect with the normal RDP client:
Start mstsc and enter the Tailscale MagicDNS name as the computer name (e.g. desktop-pc.your-tailnet-name.ts.net)
With MagicDNS on, you can use a readable host name instead of the Tailscale IP (an address in the special 100.x.x.x range). On the same LAN it connects directly in a few milliseconds; when no direct path exists, it goes through Tailscale’s relay automatically. I didn’t notice a big difference in RDP responsiveness either way.
If it doesn’t connect even though everything looks set up (Tailscale disconnected after a reboot, expired keys, firewall, credentials), see Tailscale Remote Desktop not connecting: what to check.
Optional: terminal access over SSH
RDP alone does the job, but I wanted command-line access too, and SSH is a fallback if RDP misbehaves. It’s optional; skip it if you don’t use the command line.
In a terminal opened as administrator, install OpenSSH Server, start it and set it to start automatically:
# Install OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # Start the service and set it to start automatically Start-Service sshd Set-Service -Name sshd -StartupType Automatic
One trap I actually hit: if the owner of the host keys (C:\ProgramData\ssh\ssh_host_*_key) is a normal user, the service stops right after starting (exit code 1067). Owner and permissions must be limited to SYSTEM and Administrators. S-1-5-32-544 and S-1-5-18 below are the well-known Windows identifiers for the Administrators group and SYSTEM; they’re the same on every machine.
Get-ChildItem C:\ProgramData\ssh\ssh_host_*_key | ForEach-Object {
icacls $_.FullName /setowner "*S-1-5-32-544"
icacls $_.FullName /inheritance:r /grant "*S-1-5-18:F" /grant "*S-1-5-32-544:F"
}
Start-Service sshd
Create a key pair on the laptop
If you don’t have an SSH key yet, generate a pair on the laptop. An empty passphrase works, but set one in case the laptop is lost.
ssh-keygen -t ed25519 -f ~/.ssh/laptop_ed25519
Of the two files, the contents of laptop_ed25519.pub (public key) must go to the desktop. SSH doesn’t work yet at this point, so paste it through the RDP session or carry it over on a USB stick, and add it to administrators_authorized_keys in the next step. laptop_ed25519 (no extension, the private key) must never leave the laptop.
Register the public key
If the account you sign in with is an administrator, the public key goes in C:\ProgramData\ssh\administrators_authorized_keys, not the usual ~/.ssh/authorized_keys. Append the public key to that file, then set the owner to Administrators and limit access to SYSTEM and Administrators. Otherwise the key is silently ignored.
$p = 'C:\ProgramData\ssh\administrators_authorized_keys' icacls $p /setowner "*S-1-5-32-544" icacls $p /inheritance:r /grant "*S-1-5-18:F" /grant "*S-1-5-32-544:F"
Set up the config on the laptop
Typing the host name, user name and key path every time is tedious, so add an alias to ~/.ssh/config on the laptop:
Host pc
HostName desktop-pc.your-tailnet-name.ts.net
User user
IdentityFile ~/.ssh/laptop_ed25519
Now you can connect with public key authentication and no password:
ssh pc
Security: how solid it is, and what you accept
It’s worth knowing how secure this really is and where you are taking things on trust. There are three layers:
- Traffic: solid. WireGuard encryption between devices. Tailscale doesn’t hold keys that can decrypt your traffic, and relay servers just pass the encrypted data through. Nothing to compromise on here
- Key distribution: some trust required. Tailscale’s coordination server keeps the mapping of which public key belongs to which device. If Tailscale itself were breached, some attacks would be possible in theory. For personal use I decided defending against that is overkill and chose to trust Tailscale
- Authentication: the weakest point, must be protected. Sign-in to Tailscale is delegated to an external identity provider such as Google. If that account is taken over, an attacker can add their own device to your tailnet and reach your desktop, regardless of how strong the VPN encryption is. Don’t compromise here: turn on two-factor authentication
Device Approval, set up earlier, is the safety net for that weak point. Even if the account is taken over, the attacker’s device sits waiting for approval and can’t reach your desktop.
Pros and cons of remote access with Tailscale
Pros
- No router ports opened, so there’s no entry point for brute-force attacks from outside
- Works behind a shared public IP (apartments and so on) without dynamic DNS or port forwarding
- Remarkably few settings: install the app, sign in, done
- MagicDNS lets you reach devices by name without thinking about IP addresses
- Free for personal use, with no time limit
Cons and caveats
- Authentication is delegated to an external account, so protecting that account is everything
- You have to trust a third party, Tailscale’s key distribution server, to some degree (Tailnet Lock adds protection if that worries you, though it’s a bit much for personal use)
- Disabling key expiry on the desktop keeps its key valid forever. Fine for a machine that stays home, not for one you carry
Claude Code did almost all of the setup
Most of the work above (installing OpenSSH Server, troubleshooting permissions, putting together commands) I handed to Claude Code. I just said “I want RDP over Tailscale, set up like this”, and it built and ran the commands, investigated errors, and suggested the next step.
Two things I had to keep in mind myself:
- Admin rights are needed: starting services, changing file owners and more require Windows admin rights, so the terminal running Claude Code had to be started as administrator. This isn’t specific to PowerShell; Command Prompt or the VS Code integrated terminal work the same way. What matters is whether that terminal process runs as administrator. With VS Code, start VS Code itself as administrator and its integrated terminal inherits the rights
- Make design decisions yourself: whether to enable Device Approval, how far to trust the external account for authentication, whether to disable key expiry. For decisions at the core of security, I didn’t just accept suggestions; I made sure I understood them first. Delegating the implementation is one thing, widening your exposure without understanding what’s happening is another
If you separate what you can delegate from what you must decide, you can build a setup like this on your own without being a networking or Windows services expert.
Summary
I can now reach my home PC securely from anywhere, for free, without opening a single router port. I had assumed a shared-IP apartment made this impossible, so it was much easier than expected. In exchange for the convenience, I make sure not to cut corners on authentication: two-factor authentication and Device Approval.
References: Tailscale, Tailscale vs. ZeroTier


コメント