Welcome to Centmin Mod Community
Become a Member

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 Premium Member Premium Member

    3,935
    397
    83
    May 31, 2014
    Ratings:
    +770
    Local Time:
    1:55 AM
    Nginx-1.17.x
    MariaDB 10.3.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

    133
    97
    28
    Mar 21, 2018
    Ratings:
    +153
    Local Time:
    4:25 AM
    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 Premium Member Premium Member

    3,935
    397
    83
    May 31, 2014
    Ratings:
    +770
    Local Time:
    1:55 AM
    Nginx-1.17.x
    MariaDB 10.3.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

    46,583
    10,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,420
    Local Time:
    8:55 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    IP access goes to main hostname's logs Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS