Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    4

    [SOLVED] How can I close unnecessaries ports ?


    Hi,

    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
    Location
    The Netherlands
    Posts
    1,429
    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
    Just Joined!
    Join Date
    Feb 2009
    Posts
    4
    Do you have any link to good resource about iptables ?

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,746
    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:

    Code:
    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 0.0.0.0:902             0.0.0.0:*               LISTEN      3539/xinetd         
    tcp        0      0 0.0.0.0:64423           0.0.0.0:*               LISTEN      22184/skype         
    tcp        0      0 0.0.0.0:8333            0.0.0.0:*               LISTEN      3692/httpd.vmware   
    tcp        0      0 0.0.0.0:53742           0.0.0.0:*               LISTEN      4583/rpc.statd      
    tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      2830/rpcbind        
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3637/sshd           
    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      3423/cupsd
    Example:

    Code:
    tcp        0      0 0.0.0.0:902             0.0.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.

  5. #5
    Just Joined!
    Join Date
    Feb 2009
    Posts
    4
    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
  •