PortGate

Resources · Port reference · port 3389

Port 3389 (RDP): what it is and how to secure it

Remote Desktop on port 3389 is one of the most attacked ports on the internet. Reach it through a VPN or an SSH tunnel, never directly.

Check command

sudo ss -tlnp | grep ':3389 '

Copied.

Port 3389 is Remote Desktop (RDP). It is how Windows servers, and Linux servers running xrdp, show a desktop remotely. Exposed RDP is one of the most common ways ransomware groups get in, so it should be reachable only through a VPN or an SSH tunnel.

What port 3389 is for

RDP gives a full graphical session. On Windows it is built in. On Linux, xrdp provides the same protocol so you can connect with the normal Remote Desktop app.

Why an open 3389 is dangerous

  • Constant password guessing. Bots scan the whole internet for 3389 and try passwords around the clock.
  • Stolen credentials. Passwords reused from other breaches work here.
  • Protocol bugs. RDP has had wormable pre-login flaws in the past, BlueKeep (CVE-2019-0708) being the best known. Unpatched and public is the worst combination.

A successful login is a full desktop on the server, usually as an administrator.

Check yours

Linux with xrdp:

sudo ss -tlnp | grep ':3389 '

Windows (PowerShell):

Get-NetTCPConnection -LocalPort 3389 -State Listen

From another machine, nc -vz YOUR_SERVER_IP 3389 succeeding means it is public.

Fix it

Use an SSH tunnel (Linux with xrdp). Make xrdp listen on loopback by setting the port line in /etc/xrdp/xrdp.ini:

port=tcp://127.0.0.1:3389
sudo systemctl restart xrdp

Then connect through SSH from your computer and point Remote Desktop at localhost:3389:

ssh -L 3389:127.0.0.1:3389 you@your-server

Or use a VPN. WireGuard or Tailscale on the server, RDP allowed only on the VPN interface.

Windows servers: close 3389 in the cloud provider's firewall or security group and in Windows Firewall, then connect through a VPN or your provider's bastion service. Keep Network Level Authentication (NLA) on, and set an account lockout policy.

Common mistakes

  • Moving RDP to another port. Scanners find it anyway.
  • Allowing 3389 from anywhere "just for today".
  • Forgetting the cloud firewall. A security group that allows 3389 from 0.0.0.0/0 exposes it even if the host firewall is tight on one interface.

FAQ

Is RDP safe with a strong password? Safer, not safe. It still exposes the protocol to the whole internet. Put it behind a VPN.

How do I get warned? PortGate's Server Guard alerts when 3389, or any new port, starts answering on a public address.