How to find out what service is associated with what port
Scenario / Question:
How do I find out what service is associated with what port. For example how can I find out what port secure pop3 (pop3s) uses?
Solution / Answer:
In Redhat based systems there is a file called /etc/services that contains a directory of well known services and their ports. You can view this file with a text editor or search through it using a program like grep. Do not modifiy this file because some services depend on this file to function correctly.
What port is associated with pop3s
We can search the file /etc/services using grep and looking for pop3s:
# cat /etc/services |grep pop3s pop3s 995/tcp # POP-3 over SSL pop3s 995/udp # POP-3 over SSL
What service is associated with port 465
We search the /etc/services file for port 465:
-w — Select only those lines containing matches from whole words.
# cat /etc/services |grep -w 465 smtps 465/tcp smtps # SMTP over SSL (TLS)


