The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    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,623
    Likes Received:
    21
    Trophy Points:
    38
    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.
     
  3. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  4. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    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.
     
  6. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    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.
     

Share This Page