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)
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 79 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

No Comments

Leave a reply