Sponsored Content
Full Discussion: List of Ports being used.
Operating Systems Solaris List of Ports being used. Post 302411336 by pupp on Thursday 8th of April 2010 09:49:16 AM
Old 04-08-2010
Quote:
a) Is it possible that a port no., not defined in /etc/services, be used by an application.
yes

/etc/services does not necessarily show what ports are open on your specific host. its more a repository for translating port numbers to more meaningful, human readable names... and those that are properly registered with the iana. (NIS maps "services.byname" and the NIS+ table "services" are counterparts).

if you run `netstat -a`, /etc/services will be used to translate a port number to a meaningful name. if you run `netstat -an`, port numbers will not be translated.

you can change /etc/services to whatever you like.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ports

I know i can look in the /etc/services file to look at referenced port numbers, but is there a command that will list the current ports being used? (i.e. what is the application does not have an entry in the services files :confused: ) (2 Replies)
Discussion started by: Ralf
2 Replies

2. IP Networking

ports???

Ok, I've been working in the IT field for about 3 years now and I never fully understood the concept of ip ports. I just started a new job that uses Solaris and today it kinda clicked in my head and I want to know if I'm right or wrong. Does each ip address have multiple ports. because we... (4 Replies)
Discussion started by: eloquent99
4 Replies

3. UNIX for Dummies Questions & Answers

list all ports and their relative IP@ if any

Hi all i'm working on a LINUX-based platform. i'm little confused with PORTs. i have my platform connected to many other platforms, i need to know the relative port for each IP@. i know the IP of each connected platform to mine, but i'm not sure about the relative PORT for each platform...... (4 Replies)
Discussion started by: samsal_991
4 Replies

4. HP-UX

Ports

Can any one tell the command for which process are running on a perticular port (1 Reply)
Discussion started by: zsujith
1 Replies

5. UNIX for Dummies Questions & Answers

get the list of open ports in unix?

Hi, what is the unix command to get the list of all open ports in unix? Thank you in advance (1 Reply)
Discussion started by: zainab
1 Replies

6. AIX

How to find list of userdefined ports in aix

I want to know list of userdefined ports available in aix .Suppose I want to run a process at port 20 .using netstat i could able to find out that no process is listening at that 20 .Still I am not able to bring my process up at port 20. Thanks kittu (1 Reply)
Discussion started by: kittu1979
1 Replies

7. Solaris

List TCP ports with process

Hello, One of our developers is asking for a command/script in Solaris similar to "netstat -anp" in Linux. He gave this output as an example: root@xxx:~# netstat -anp | grep LISTEN tcp 0 0 0.0.0.0:7937 0.0.0.0:* LISTEN 16082/nsrexecd tcp 0 ... (7 Replies)
Discussion started by: vimes
7 Replies

8. UNIX for Advanced & Expert Users

Ports

** forum admins: Before you come down on my like a wrath of something, I can get no decent answers so I have to come to these Gurus' court *** I am by no means Unix expert. However, none of our unix admin (aix & hpux) can give me an answer that makes sense. My Issue: Assigned ports in 8601,... (7 Replies)
Discussion started by: rsheikh
7 Replies

9. Shell Programming and Scripting

Script to Monitor List of Ports

Hi, I'm in need of a script that can monitor a list of 12 ports.. If one of the ports isn't in listening mode then email me.. The list of ports are 26401 - 26412.. (6 Replies)
Discussion started by: eclipseagent
6 Replies

10. UNIX for Dummies Questions & Answers

How do i list running process with the ports they are using?

How do i list the running process and also view the ports they are listening to at the same time? (3 Replies)
Discussion started by: mena
3 Replies
SERVICES(5)                                                  Linux Programmer's Manual                                                 SERVICES(5)

NAME
services - Internet network services list DESCRIPTION
services is a plain ASCII file providing a mapping between human-friendly textual names for internet services, and their underlying assigned port numbers and protocol types. Every networking program should look into this file to get the port number (and protocol) for its service. The C library routines getservent(3), getservbyname(3), getservbyport(3), setservent(3), and endservent(3) support querying this file from programs. Port numbers are assigned by the IANA (Internet Assigned Numbers Authority), and their current policy is to assign both TCP and UDP proto- cols when assigning a port number. Therefore, most entries will have two entries, even for TCP-only services. Port numbers below 1024 (so-called "low numbered" ports) can be bound to only by root (see bind(2), tcp(7), and udp(7)). This is so clients connecting to low numbered ports can trust that the service running on the port is the standard implementation, and not a rogue service run by a user of the machine. Well-known port numbers specified by the IANA are normally located in this root-only space. The presence of an entry for a service in the services file does not necessarily mean that the service is currently running on the machine. See inetd.conf(5) for the configuration of Internet services offered. Note that not all networking services are started by inetd(8), and so won't appear in inetd.conf(5). In particular, news (NNTP) and mail (SMTP) servers are often initialized from the system boot scripts. The location of the services file is defined by _PATH_SERVICES in <netdb.h>. This is usually set to /etc/services. Each line describes one service, and is of the form: service-name port/protocol [aliases ...] where: service-name is the friendly name the service is known by and looked up under. It is case sensitive. Often, the client program is named after the service-name. port is the port number (in decimal) to use for this service. protocol is the type of protocol to be used. This field should match an entry in the protocols(5) file. Typical values include tcp and udp. aliases is an optional space or tab separated list of other names for this service. Again, the names are case sensitive. Either spaces or tabs may be used to separate the fields. Comments are started by the hash sign (#) and continue until the end of the line. Blank lines are skipped. The service-name should begin in the first column of the file, since leading spaces are not stripped. service-names can be any printable characters excluding space and tab. However, a conservative choice of characters should be used to minimize compatibility problems. For example, a-z, 0-9, and hyphen (-) would seem a sensible choice. Lines not matching this format should not be present in the file. (Currently, they are silently skipped by getservent(3), getservby- name(3), and getservbyport(3). However, this behavior should not be relied on.) This file might be distributed over a network using a network-wide naming service like Yellow Pages/NIS or BIND/Hesiod. A sample services file might look like this: netstat 15/tcp qotd 17/tcp quote msp 18/tcp # message send protocol msp 18/udp # message send protocol chargen 19/tcp ttytst source chargen 19/udp ttytst source ftp 21/tcp # 22 - unassigned telnet 23/tcp FILES
/etc/services The Internet network services list <netdb.h> Definition of _PATH_SERVICES SEE ALSO
listen(2), endservent(3), getservbyname(3), getservbyport(3), getservent(3), setservent(3), inetd.conf(5), protocols(5), inetd(8) Assigned Numbers RFC, most recently RFC 1700, (AKA STD0002). COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2010-05-22 SERVICES(5)
All times are GMT -4. The time now is 08:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy