Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Ip conection

Discussion in 'Security' started by m-mehdipoor, Apr 6, 2012.

  1. m-mehdipoor

    m-mehdipoor Registered

    Joined:
    Apr 6, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Hello,
    I want to know is there any command to see how many IPs and connections are there on each account...
    I use this commend to see the whole
    HTML:
    netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
    but I want to see the IPs and connection on per account.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The connections cannot be separated into per cPanel account basis when you have multiple accounts on the same IP address (the shared IP). netstat doesn't log that type of information as far as I'm aware. You'd have to use some other tool. tcpdump might provide some of what you need.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    Connections are established on services that are running on specific ports. They are not established on cPanel accounts.
    Using netstat you can determine connections established on each port.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    175
    Likes Received:
    9
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    I believe theres still a way to do this, without netstat though.

    You can build a script to grab the info from Main >> Server Status >> Apache Status and separate the amount of IPs based on the VHost directive.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    That would only show connections for Apache rather than all connections. The only valid way to get an idea would be for every account to have its own dedicated IP and then to use netstat to check what IP they are hitting.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    175
    Likes Received:
    9
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    I know there is no port 80 on the netstat output although I think thats what he is trying to achieve, or at least what it would make a bit of sense to achieve.

    If it isnt, having a dedicated IP set for every account wont work 100% neither, people/bots/etc will still be able to connect/login to Mail, FTP, etc of the site account by using the main server IP nor shared IP as well.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice