Open/close of ports

Hi,

I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing?

I have commented out a port /etc/services, one application uses

then when i use the telnet <hostname[localhost]> <port_blocked> it shows connected..

ideally it should not come right?

Or Am i missing anything here?

Thanks,
Bala

---------- Post updated at 06:23 PM ---------- Previous update was at 05:51 PM ----------

This is the steps I followed

  1. I stopped the service which is running on 3500 port
  2. checked the netstat -an | grep 3500 ==> no outputs
  3. checked the port in /etc/services, it is commented out
  4. ran this command

su root -c "/etc/init.d/xinetd restart"

Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

  1. telnet mypc.com 3500
    Trying 10.177.58.254...
    telnet: connect to address 10.177.58.254: Connection refused
    telnet: Unable to connect to remote host: Connection refused

This looks good, as expected i believe

  1. Now I started the service on the port 3500

  2. Service started successfully ?? How, it should not right?

  3. Issue the telnet

telnet mypc.com 3500
Trying 10.177.58.254...
Connected to mypc.com (10.177.58.254).
Escape character is '^]'.

Now it is connected...
Am i somewhere wrong here?

I want to close the port.. but it is not working.

Pl assist me here.

1) Do you have every possible service listed in /etc/services running itself? If not, it's a straightforward logical jump that /etc/services doesn't actually control anything.

2) If you're using xinetd to control the service, there's no point starting the service manually. xinetd starts services itself in response to connections on ports, if you have configured it to do so.

3) By turning on the service manually, you're bypassing xinetd. If you're not having xinetd control the service, xinetd isn't relevant at all.

4) To stop the service from starting without xinetd, tell the system's rc system to not start it. How to do this depends on what your system actually is. What is it?

5) Turning on a service manually then wondering why it's running doesn't make a lot of sense, it started because you told it to.