Running a script on login

From: Chris Jensen (cjensen_at_gmail.com)
Date: 09/11/05

  • Next message: Nicolas Alejandro Salvo: "Re: Running a script on login"
    Date: Sun, 11 Sep 2005 13:59:46 +1000
    To: secureshell@securityfocus.com
    
    

    Hi,
    I'm trying to figure out how to run a script upon a successful login
    (of any user) via openssh.
    The ssh server is being setup for very limited remote access, so we'd
    like to monitor logins by having an email sent to the administrator
    whenever a user is successfully logged in.
    We only want the script to trigger for openssh logins (local logins
    we're not interested in), but I can't figure out how to set this up
    other than in the .bash_profile
    The other thing I considered was having a cron job watch the
    authentication logs, but I'd prefer something that runs only when
    necissary than having to constantly poll the logs.

    I've googled and come up with nothing, and read through all the config
    options and can't find anything. I also thought of using a PAM module
    to do this, but can't find anything appropriate.

    Any ideas?

    Regards
    Chris


  • Next message: Nicolas Alejandro Salvo: "Re: Running a script on login"

    Relevant Pages

    • Re: Running a script on login
      ... >I'm trying to figure out how to run a script upon a successful login ... >via openssh. ... >like to monitor logins by having an email sent to the administrator ...
      (SSH)
    • Re: writting to already connected database
      ... Logins.....that would confuse you and probably the script as well. ... username and password submited by a form exsist and that they match. ... script verifies that the username and password match have it write those values ... to is "logins" and the name of the column inside the table is "Logins". ...
      (microsoft.public.frontpage.client)
    • Re: aix shell script
      ... > I need a shell script to stop duplicate concurrent logins. ... auth1 = SYSTEM,auth_method ... "root" should be set as an exception to this rule: ...
      (comp.unix.aix)
    • Re: aix shell script
      ... timed log out: ... there is a timed-logout variable for the shell. ... >>I need a shell script to stop duplicate concurrent logins. ...
      (comp.unix.aix)
    • Re: audit administrator login
      ... You could use this script and put it into a batch file with a list of your computer names passed as the for-next loop. ... Set colListOfServices = objWMIService.ExecQuery _ ... This posting is provided "AS IS" with no warranties, ... what is the best way to audit domain administrator logins, ...
      (microsoft.public.windows.server.active_directory)