Cheese – Who’s trying to log into my machine

Cheese – Who’s trying to log into my machine

So at work we are currently testing a beta version of a new code release on remote laptops in different  public locations which are secure but accessible. On the way home from work I had the thought that if a competitor knew that new beta code was on a public laptop then who knows they might try to log into the laptop. So thinking about this I started to write a script to call the webcam and take a picture then email. We already use ffmpeg on our servers but the script it using avconv to capture the image as this is the replacement for ffmpeg. You use avconv to get the connection to the webcam which is normally /dev/video0 on most system but its worth checking this out using lsusb. I’ve made the capture of the picture into a function call cheese and the email component into a function called mcheese.

You will need to install avonv  for capturing the video from the webcam and mutt for sending the email with attachment – if you need instructions for that let me know

This is only a beta version I have a lot more to do on this to make it more efficient for example make the list function get the latest picture to email  better list=$(ls -d "$PWD"/* | tail -n 1)



To get the script working with the incorrect login attempt you need to associate the script with PAM –  the guys at askubuntu had some good information on this as the below shows

  • Nano /etc/pam.d/common-auth
  • Edit the line below so success equals 2
  • Underneath this line add the following so an incorrect password will invoke the script


I’ve decided that this will be my next project for an android app- I’ve already started work on this and rather excited



Comments (3)

  1. Hey!

    Nice website and nice project overall! Wish you much luck mate! Seen your app on Gmarket, your website looks equally awesome on Mobile Firefox under Sandwich and on Desktop Firefox under OpenSuse. Thanks for sharing this nice capture script, its just crying for expansion hehe :)

    Have a good one!

Leave a Reply to admin - Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>