Skip to content
statance
MenuClose
← All ports

Port 6000: X11

High risk

Port 6000 is the X Window System for display :0 (6001 for :1). It is used when graphical programs connect to an X server over the network. It should not be reachable from the public internet.

Port
6000
Protocol
TCP
Service
X11
Expose to internet?
No

Is port 6000 safe to open?

An X server that accepts network connections without access control (for example after xhost +) lets anyone capture screenshots, log keystrokes and inject input. Modern distributions start Xorg with -nolisten tcp, so a listening 6000 is a sign of deliberate or legacy configuration.

How to secure X11

  • Keep -nolisten tcp on the X server.
  • Use SSH X forwarding (ssh -X) instead of direct X11 connections.
  • Never run xhost +.

Check if port 6000 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':6000 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 6000 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 6000 # or nmap -p 6000 HOST # Windows Test-NetConnection HOST -Port 6000

Restrict port 6000 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:6000:6000) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 6000 proto tcp sudo ufw deny 6000/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=6000/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="6000" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 6000 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 6000 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 6000 from internet" -Direction Inbound -Protocol TCP -LocalPort 6000 -RemoteAddress Internet -Action Block

Monitor port 6000

Run a TCP port monitor against your public IP on port 6000: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 5900VNCHigh risk
Port 22SSHMedium risk

FAQ

What is port 6000 used for?

Port 6000 is the X Window System for display :0 (6001 for :1). It is used when graphical programs connect to an X server over the network.

Is it safe to open port 6000?

Not to the public internet. An X server that accepts network connections without access control (for example after xhost +) lets anyone capture screenshots, log keystrokes and inject input. Modern distributions start Xorg with -nolisten tcp, so a listening 6000 is a sign of deliberate or legacy configuration.

Is port 6000 TCP or UDP?

X11 uses TCP on port 6000.

How do I check if port 6000 is open?

On the server, run sudo ss -tulpn | grep ':6000 ' (Linux) or Get-NetTCPConnection -LocalPort 6000 (Windows) to see what is listening. From another machine, run nc -zv HOST 6000 or Test-NetConnection HOST -Port 6000.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.