ssh user logged in

Discussion in 'Server Operation' started by Tom John, Aug 29, 2021.

  1. Tom John

    Tom John Active 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:
    Code:
    #!/bin/bash
    
    echo "Login auf $(hostname) am $(date +%Y-%m-%d) um $(date +%H:%M)"
    echo "Benutzer: $USER"
    echo
    finger
    
    
    in /etc/profile i add:
    Code:
    /opt/shell-login.sh | 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:
    Code:
    Aug 29 16:56:48 server2 named[842441]: client @0x7f6108005120 141.126.219.183#80 (sl): query (cache) 'sl/ANY/IN' denied
    Aug 29 16:57:05 server2 named[842441]: client @0x7f610c00a550 109.148.115.78#80 (pizzaseo.com): query (cache) 'pizzaseo.com/RRSIG/IN' denied
    
    
    from the script i get the following response:
    Code:
    Login auf serverx am 2021-08-29 um 16:44
    Benutzer:
    
    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.
     
  3. Tom John

    Tom John Active Member HowtoForge Supporter

    thanks a lot for your kind help
    so amazing you guys are always here to help
    thanks
     

Share This Page