ssh user logged in

Discussion in 'Server Operation' started by Tom John, Aug 29, 2021 at 5:00 PM.

  1. Tom John

    Tom John Member HowtoForge Supporter

    Hi guys,
    i use ubuntu 20.04 with the standard configuration the perfect server
    i use a shell script for detect if a user is logged in into the system:
    echo "Login auf $(hostname) am $(date +%Y-%m-%d) um $(date +%H:%M)"
    echo "Benutzer: $USER"
    in /etc/profile i add:
    /opt/ | mailx -s "SSH-Log-in auf server" mymailaddress
    on all servers it is working perfectly only on one server i get the email every minute even no user is logged in.
    in the logfiles i see one entry often:
    Aug 29 16:56:48 server2 named[842441]: client @0x7f6108005120 (sl): query (cache) 'sl/ANY/IN' denied
    Aug 29 16:57:05 server2 named[842441]: client @0x7f610c00a550 ( query (cache) '' denied
    from the script i get the following response:
    Login auf serverx am 2021-08-29 um 16:44
    No one logged on.
    who gives nobody is logged in
    Any idea what is going wrong why i get an email always even nobody is logged in?
    thanks a lot for your kind help
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Probably your script gets triggered by cronjobs then as well.

    Which is not related to SSH at all. Someone tried to query a domain by using your DNS server and your DNS server denied that query.

Share This Page