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 ...