Re: Running a script on login

From: Nicolas Alejandro Salvo (nsalvo_at_pictage.com.ar)
Date: 09/11/05

  • Next message: Marcin Sura: "Timeouty while using SFTP subsystem of OpenSSH."
    Date: Sun, 11 Sep 2005 15:00:03 -0300
    To: secureshell@securityfocus.com
    
    

    You can use something like this in /etc/hosts.allow

    sshd : xxx.xxx.xxx/8 : spawn (echo -e "External ssh connection from %h
    " | mail -s "SSH connection from Internet" xxx@gmail.com) : ALLOW

    Chris Jensen wrote:

    >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: Marcin Sura: "Timeouty while using SFTP subsystem of OpenSSH."

    Relevant Pages

    • Running a script on login
      ... I'm trying to figure out how to run a script upon a successful login ... We only want the script to trigger for openssh logins (local logins ...
      (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)
    • Problem with OpenSSH
      ... I have a tiny problem with OpenSSH. ... no logins with passwords. ... no matter what I change these two configurations ...
      (SSH)