Results 1 to 5 of 5

Thread: Close ports in linux

  1. #1
    Join Date
    Mar 2010
    Posts
    200

    Close ports in linux

    Hello,
    I made a
    Code:
    netstat-a - inet
    to see that bcp more open port that I want, I want to do that with port 80 ssh ftp and mysql. How can i do this, if you guys have any idea about this then please let me know. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    583

    Re: Close ports in linux

    Hello,
    You can use iptables (firewall configuration manually). See 'man iptables' lea-linux.org or for more information. Otherwise you can use a firewall while is like shorewall, firestarter. But I think the best way is to use the iptables, this will surely help you. Also I recommend you to go through the man pages of the the iptables, because there are many option for this command you will get confused if you do not know them.

  3. #3
    Join Date
    Nov 2009
    Posts
    359

    Re: Close ports in linux

    Hello,
    The question is how it reduce the number of open port visible from the outside or how to reduce the number of open port? In the first case, just as noted by the above post, activate the firewall and block access to port not desired. In the second case, one must question the source of the demons who listen to these different ports and close them manually (not ports, services).

  4. #4
    Join Date
    Dec 2009
    Posts
    296

    Re: Close ports in linux

    Hello,
    I have a similar kind of a problem with the ports and the commands related to the ports under linux. My case is the second as it is posted above, but my problem is that I can not understand what has turned around the order
    Code:
    netstat-a - inet
    What I have to do to eliminate unwanted services? Any help regarding this is appreciated. Thanks in advance.

  5. #5
    Join Date
    Nov 2009
    Posts
    446

    Re: Close ports in linux

    Hello,
    To find out which ports are listening and the application that uses them, just use this
    For example
    Code:
    test @ ex% lsof | grep LISTEN
    583 root 11u IPv4 master 0xc0da4000 0T0 TCP *: smtp (LISTEN)
    XFree88 root 1u IPv4 882 TCP * 0T0 0xc0da413c: X11 (LIST
    EN)
    We see that two processes are listening on two ports and applications that have launched. I hope you have understood what I am trying to say.

Similar Threads

  1. USB ports and Mobo USB ports on PC Case
    By Eta!! in forum Motherboard Processor & RAM
    Replies: 7
    Last Post: 12-09-2011, 10:34 PM
  2. Replies: 3
    Last Post: 03-01-2011, 06:37 AM
  3. Replies: 3
    Last Post: 20-08-2009, 10:46 PM
  4. how to forward ports to different internal ports
    By Abshir in forum Networking & Security
    Replies: 2
    Last Post: 30-06-2009, 10:26 PM
  5. How to open close ports manually?
    By Darsheet in forum Networking & Security
    Replies: 6
    Last Post: 22-05-2009, 08:19 AM

Posting Permissions

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