Save photos when entering wrong password in Ubuntu

Step 1 : Installing App to take photo (optional if already exists)

For more ways to take picture refer this article.

$ sudo apt update
$ sudo apt install ffmpeg

Step 2 : Create script to save photos

$ sudo gedit /usr/local/bin/takepic

Paste the following

#!/bin/bash

filename=`date +%s`
ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 1 /tmp/$filename.jpg

exit 0

Save and close.

$ sudo chmod +x /usr/local/bin/takepic 

Step 3 : Configure PAM 

Backup the original file

$ sudo cp /etc/pam.d/common-auth /etc/pam.d/common-auth.orginal
$ sudo gedit /etc/pam.d/common-auth 
  • Update
    • auth    [success=1 default=ignore]    pam_unix.so nullok_secure
  • To
    • auth    [success=2 default=ignore]    pam_unix.so nullok_secure
  • Add the following, next to the updated line
    • auth    [default=ignore]               pam_exec.so seteuid /usr/local/bin/takepic

Then save it. Try and have fun

That's it folks!

 

 

Comments

  1. It is very easy to allow access through AVG firewall for that the user should open the user interface after that the user should open the main window and should click on the “firewall” option after that the user should click on the “settings icon” then as the settings menu opens the user should choose the option “advanced settings.” If needed then to know more regarding the process the user should connect with the technicians at +44-800-368-9064.
    AVG Contact Number UK
    AVG Helpline Number UK

    ReplyDelete

Post a Comment

Popular posts from this blog

How to install MRTG on UBUNTU

How to install Apache Tomcat in Ubuntu

How to mine cryptocurrency using unMineable