Learn about Centmin Mod LEMP Stack today
Register Now

Which log file should i check for connections to ip of the server?

Discussion in 'System Administration' started by pamamolf, Mar 5, 2020.

  1. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    6:02 PM
    Nginx-1.29.x
    MariaDB 10.6.x
    Hello

    Which log file should i check for connections to ip of the server?

    Any command that will help me to find out the top 10 ip's that they are connecting directly to my server ip?

    Thank you

     
  2. brijendrasial

    brijendrasial Active Member

    214
    155
    43
    Mar 21, 2018
    Ratings:
    +237
    Local Time:
    8:32 PM
    1.13.9
    10.0.22-MariaDB
    How about this

    netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
     
  3. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    6:02 PM
    Nginx-1.29.x
    MariaDB 10.6.x
    Thanks for your reply....

    Not sure that it will have connections to local ip address ...

    At the moment the server may not have connections directly to the server ip but as i am logged in using ssh i think it should have at the output the server ip with one connection but it doesn't list the server ip at all.....
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,904
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    1:02 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    IP access goes to main hostname's logs Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS