Telnet is not happening on port number 8080

Dear Experts,

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.

Can someone please help me on this?

Regards,
Rockie

Did you update /etc/inetd.conf?

Thanks RudiC for your quick reply.

in /etc/services, we have entry for the service

xxxxx 8080/udp #

but in /etc/inetd.conf, there is entry for only telnet not for the service, is it necessary put entry in /etc/inetd.conf for the xxxxx services?

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.

I hope this helps.

bakunin

1 Like

Yes, it is. Please c.f man inetd .

1 Like

Thanks a lot Bakunin and RudiC for the gentle explanation. Let me check and update.. thanks..

---------- Post updated at 05:15 AM ---------- Previous update was at 02:53 AM ----------

corrected udp as tcp, still its not working, any help pls

WHAT did you correct?

RudiC, Previously it was 8080/udp, not it is 8080/tcp in /etc/services, for this should we have any entry in inetd.conf?

inetd.conf is the relevant place to modify inetd 's behaviour. Put in there the correct service, protocol, and server program.

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:

telnet8080    stream    tcp   nowait  root    /usr/sbin/telnetd       telnetd

finally you ned to restart inetd , which is controlled by the System Resource Controller:

root@yourhost # refresh -s inetd

To test the connection try:

user@remotesystem # telnet yourhost 8080

You might further test with

user@yourhost # netstat -a | grep LISTEN
[...]
tcp        0      0  *.telnet8080           *.*                    LISTEN
[...]

which should show your daemon listening to the port.

I hope this helps.

bakunin

1 Like