Open ports on UNIX

Posted on 2006-06-01
Last Modified: 2008-02-01
 I would like to know which command to use to know the port information on a UNIX Box and I would like to know about the open ports and closed ports.
Question by:koppcha
    LVL 10

    Expert Comment

    Redhat 7.2 sets up an iptables-based firewall for you automatically during installation. To open a tcp port use something like:

    iptables -A INPUT -s <source-ip/wildcard> -p tcp -m tcp --dport <port-number> -j ACCEPT
    LVL 34

    Accepted Solution

    If you want to see what ports are currently in use, the command is --> netstat -a

    Opening a port via IP tables merely makes it accessible. There has to be something listening on it.
    LVL 23

    Expert Comment

      netstat -ab
      netstat -a
    if your unix distribution's netstat does not support the -b option.
    LVL 87

    Expert Comment

    iptables --list

    shows you which rules are setup

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
    Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now