Port 111 is rpcbind, the Sun RPC portmapper. It tells clients which ports RPC services such as NFSv3 mountd and statd are using. It should not be reachable from the public internet.
- Port
- 111
- Protocol
- TCP and UDP
- Service
- rpcbind (portmapper)
- Expose to internet?
- No
- Also used by
- NFSv3, NIS
Is port 111 safe to open?
Anyone who can reach rpcbind can list the RPC services on the machine, which maps out NFS and other internal services. The UDP service can be abused for reflection and amplification DDoS attacks. It is only needed for NFSv3 and legacy RPC services, never from the internet.
How to secure rpcbind (portmapper)
- If you do not use NFSv3 or NIS, disable it:
sudo systemctl disable --now rpcbind rpcbind.socket. - Use NFSv4 only, which does not need rpcbind.
- Block TCP and UDP 111 on public interfaces.
Check if port 111 is open
Linux: what is listening on this port
sudo ss -tulpn | grep ':111 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 111 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 111
# or
nmap -p 111 HOST
# Windows
Test-NetConnection HOST -Port 111Test the rpcbind (portmapper) service itself
rpcinfo -p HOSTRestrict port 111 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:111:111) 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 111 proto tcp
sudo ufw deny 111/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=111/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="111" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 111 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 111 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 111 from internet" -Direction Inbound -Protocol TCP -LocalPort 111 -RemoteAddress Internet -Action BlockMonitor port 111
Run a TCP port monitor against your public IP on port 111: 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
FAQ
Why is port 111 open on my Linux server?
rpcbind is installed as a dependency of nfs-common or nfs-utils on many distributions and starts automatically. Disable it if the server does not mount or export NFSv3 shares.
What is port 111 used for?
Port 111 is rpcbind, the Sun RPC portmapper. It tells clients which ports RPC services such as NFSv3 mountd and statd are using. It is also used by NFSv3, NIS.
Is port 111 TCP or UDP?
rpcbind (portmapper) uses TCP and UDP on port 111.
How do I check if port 111 is open?
On the server, run sudo ss -tulpn | grep ':111 ' (Linux) or Get-NetTCPConnection -LocalPort 111 (Windows) to see what is listening. From another machine, run nc -zv HOST 111 or Test-NetConnection HOST -Port 111.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.