Port 636 is LDAP over TLS. It carries the same directory queries as port 389, encrypted from the start of the connection. It should not be reachable from the public internet.
- Port
- 636
- Protocol
- TCP
- Service
- LDAPS
- Expose to internet?
- No
- Also used by
- Active Directory, OpenLDAP, FreeIPA
Is port 636 safe to open?
Encryption protects credentials in transit, but the directory still holds every account in the organisation. Exposing LDAPS to the internet invites password spraying and lookups of usernames. Cloud services that need it should be allowlisted by IP.
How to secure LDAPS
- Allow 636 only from the networks and services that need directory access.
- Use a certificate clients actually validate rather than a self-signed one they ignore.
- Disable anonymous binds and use dedicated, least-privilege service accounts.
Check if port 636 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':636 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 636 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 636
# or
nmap -p 636 HOST
# Windows
Test-NetConnection HOST -Port 636Test the LDAPS service itself
openssl s_client -connect HOST:636 </dev/nullRestrict port 636 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:636:636) 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 636 proto tcp
sudo ufw deny 636/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=636/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="636" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 636 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 636 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 636 from internet" -Direction Inbound -Protocol TCP -LocalPort 636 -RemoteAddress Internet -Action BlockMonitor port 636
Run a TCP port monitor against your public IP on port 636: 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
What is port 636 used for?
Port 636 is LDAP over TLS. It carries the same directory queries as port 389, encrypted from the start of the connection. It is also used by Active Directory, OpenLDAP, FreeIPA.
Is it safe to open port 636?
Not to the public internet. Encryption protects credentials in transit, but the directory still holds every account in the organisation. Exposing LDAPS to the internet invites password spraying and lookups of usernames. Cloud services that need it should be allowlisted by IP.
Is port 636 TCP or UDP?
LDAPS uses TCP on port 636.
How do I check if port 636 is open?
On the server, run sudo ss -tulpn | grep ':636 ' (Linux) or Get-NetTCPConnection -LocalPort 636 (Windows) to see what is listening. From another machine, run nc -zv HOST 636 or Test-NetConnection HOST -Port 636.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.