question about /etc/services in Unix servers

LindaC
LindaC used Ask the Experts™
on
Hi experts.

I know that the /etc/services is to document the ports already in use.
I need to know how I can document in the /etc/services a range of ports.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
>>I know that the /etc/services is to document the ports already in use.

Incorrect.  It is just a mapping file for known ports.  Something can be using a port that is not defined in services.

http://en.wikipedia.org/wiki/Inetd
"The file /etc/services is used to map port numbers and protocols to service names"

>>I need to know how I can document in the /etc/services a range of ports.

I do not believe you can.  You need to list each port/name individually.
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Why the B grade?  What additional information did you need to give this an A?

Author

Commented:
Hi.

What additional information did you need to give this an A?

I was expecting something like this:

"Run this script as root so that you will have in a text file, the ports that are being used"
After you add the proper comments to this text file  adding this to each line (example)
    # Comment-This port is for Oracle Apex
then you run this  other script to add the content of this text file to the /etc/services.
This must be run by root.
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
You asked if it was possible to add a range of ports to the services file.  I answered that with no, you need to add them individually.

If you were looking for a script to take some range in some format and create the individual entries in your services file, why didn't you ask for a script?

Author

Commented:
You are correct. I should have asked for the script.

I have requested the attention so that it can be changed.

Author

Commented:
Thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial