- Keep directory and authentication services on internal networks.
- Require signing or TLS and disable anonymous queries.
- Monitor authentication failures for spraying and brute force.
Port 31: MSG Authentication
Port 31 is assigned by IANA to msg-auth (MSG Authentication).
How msg-auth works
Directory & authenticationThe client proves who it is on port 31 and gets an answer (or a ticket) it can use with other services.
- Transport
- TCP · UDP
- Exposure risk
- not rated depends on the program listening
- Encryption
- Unknownnot stated by the registry
- IANA status
- Assigned1 registered service
- Range
- Well-known (0-1023)
- Category
- Directory & authentication
Is port 31 dangerous?
We have no specific security note for port 31. Its risk depends on the program actually listening on it. General advice for directory & authentication services:
IANA registry entries for port 31
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| msg-auth | 31 | TCP, UDP | MSG Authentication | - | - |
// source: IANA service name and port number registry
Which program uses port 31, and is it reachable?
Linux
sudo ss -ltnup 'sport = :31' # process listening on 31
sudo lsof -nP -i :31macOS
sudo lsof -nP -i :31
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 31 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 31 netstat -ano | findstr :31
From another machine
nmap -p 31 -sV <host> sudo nmap -sU -p 31 <host> nc -zv <host> 31
Block it in the firewall
sudo ufw deny 31/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 31" -Direction Inbound -LocalPort 31 -Protocol TCP -Action Block # Windows
What is port 31 used for?
Port 31 is assigned by IANA to msg-auth (MSG Authentication).
Is port 31 TCP or UDP?
Port 31 is registered for TCP and UDP.
Is it safe to open port 31?
It depends on the program that listens on it. Open it only for a service you know and only to the networks that need it. Keep directory and authentication services on internal networks.
How do I check if port 31 is open?
On Linux run "ss -ltnup 'sport = :31'", on macOS "lsof -nP -i :31", and on Windows "netstat -ano | findstr :31" to see the local process. From another machine, "nmap -p 31 <host>" shows whether it is reachable.