I am trying to open 8080 port on my Aix 7.1 server. I made an entry in /etc/services for the port. and refreshed the inetd service. But when I try to telnet localhost 8080, telnet is not happening. connection refused error is coming.
I can able to telnet localhost 23 its working fine, but its not working for 8080.
I suppose there are a few misconceptions to clear:
The file /etc/services is not actively doing anything. It is a mere directory of ports, like i.e. /etc/hosts is for IP addresses/host names. Nobody would expect a host to get a "hostname configured" just because it was entered in /etc/hosts and the same is true for /etc/services .
In fact it is like this: a "port" is a (layer 4 of the OSI reference model) addressing device like the IP address is (the layer 3 addressing device). Behind every port (0-65535) can "wait" a process - or not. Picture an IP-host to be like a large house (the IP address) with lots of apartments (ports). When you ring the bell at a certain apartment (connect to a certain port) maybe someone is at home and answers (there is some process taking packets coming in at that port) or nobody is at home and then nobody answers your ringing.
Common protocols (telnet, ftp, ssh, http, ....) have a certain port where they "usually" answer. This is done by configuring the respective programs (usually "daemons", because they work in background) to bind to the respective port. In principle you can configure any service to use any port, but there are some defaults.
When you "telnet" a host and it answers the following happens: at the start of the IP stack some process (the telnetd daemon) is started at the host which binds to port 23 (per default - maybe configured to use some other port) and then listens to incoming connections at that port. When you now enter "telnet hostname" at some remote host you start a client program which contacts "hostname" at port 23 and from there the telnetd picks it up, establishes a connection (so-called "virtual channel") and at some point this is dissolved again, ending the connection.
The "connection refused" error you get is just an indication that your telnetd does not listen to port 8080. Btw., you usually have TCP, not UDP, as transport protocol for telnet.
As it is, the AIX telnetd looks up /etc/services when it starts. I forgot to mention that in my first post because it is in the man page and i thought it to be obvious. To configure such a service for a specific port you do the following (note that you might have to change some details for your purpose, the picture should be clear anyways):
enter a line in /etc/services defining a (best unique) service name and the port:
telnet8080 8080/tcp
Then modify your /etc/inetd.conf by adding a line to define this service: