Get the most out of your Centmin Mod LEMP stack
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,885
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    11:42 PM
    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

    126
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    3:12 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,885
    381
    83
    May 31, 2014
    Ratings:
    +741
    Local Time:
    11:42 PM
    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

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:42 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