Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [SOLVED] How can I close unnecessaries ports ?


    I have just working with linux (CentOS 5.2)
    I have seen around ten of ports are unwanted ports and need to be closed.
    How can I close those port via command line ?

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    The Netherlands
    with IPTABLES.
    IPTABLES is a Firewall that is nested in your kernel. ITs CLI but there are a tremendous amount of GUIs for it.

    Have fun =)
    New Users, please read this..
    Google first, then ask..

  3. #3
    Do you have any link to good resource about iptables ?

  4. $spacer_open
  5. #4
    If ports are "open" it's because there is a process "listening" on that port. You close ports by disabling the processes you don't want running.

    You can Google for netstat:

    netstat -anp | more
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
    tcp        0      0   *               LISTEN      3539/xinetd         
    tcp        0      0 *               LISTEN      22184/skype         
    tcp        0      0  *               LISTEN      3692/httpd.vmware   
    tcp        0      0 *               LISTEN      4583/rpc.statd      
    tcp        0      0   *               LISTEN      2830/rpcbind        
    tcp        0      0    *               LISTEN      3637/sshd           
    tcp        0      0 *               LISTEN      3423/cupsd

    tcp        0      0   *               LISTEN      3539/xinetd
    Port 902 is open - listening on all interfaces (not any certain IP). PID 3593 has it open, which is xinetd.

  6. #5
    Thanks a lot ! , good example

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts