Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Run script on failed login attempt

  1. #11
    Join Date
    Jun 2010

    Re: Run script on failed login attempt

    We have a winner!

    Your solution is much better thank you.

  2. #12
    Join Date
    Apr 2008
    Far, far away
    Ubuntu 11.04 Natty Narwhal

    Re: Run script on failed login attempt

    If for a laptop/notebook in a theft situation...

    My latest thoughts are that a pam script should upload captured images to some file hosting service and/or email them, or a link. This way once they're captured they get sent off to "somewhere" you can get to, along with some IP info.

    The reason being that once they boot up and try to login a couple times unsuccessfully they'll probably install Windows and be done with it. You want to catch as much ID/Location info as you can in the briefest opportunity before it's gone.

  3. #13
    Join Date
    Jun 2010

    Re: Run script on failed login attempt

    Here we go, this is the end result.
    Using the uuencode and mailx will send the captured jpgs to my e-mail account the second a network connection is found.

    Since I am on a college campus with an auto-connect set up for the campus wide wifi this will work fine for a anti-theft device (or at least I can see the face of the dude that stole my laptop while he is within range of campus).

    Thanks for all of the help everyone.

    #! /bin/bash
    USR=[your user name]
    TIMESTAMP=$(date +%R.%S-%B-%d)
    cd /home/$USR/Pictures/Webcam/
    streamer -t 10 -r 1 -s 640x480 -o cap00.jpeg > /dev/null
            cp cap03.jpeg $TIMESTAMP-1.jpg
            cp cap04.jpeg $TIMESTAMP-2.jpg
            cp cap05.jpeg $TIMESTAMP-3.jpg
            cp cap06.jpeg $TIMESTAMP-4.jpg
            cp cap07.jpeg $TIMESTAMP-5.jpg
            rm cap*
    (for i in *.jpg
          uuencode $i $(basename $i) 
    ) | mailx -s "Security Allert- $TIMESTAMP" $EMAIL
    mv /home/$USR/Pictures/Webcam/*.jpg /home/$USR/Pictures/Webcam/old/
    Last edited by kkaldroma; September 29th, 2010 at 03:33 PM. Reason: Cleaned up the code

Page 2 of 2 FirstFirst 12


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts