I want to display a video when a wrong password is entered (say only in GUI login screen or within the display manager).

I have added a line to /etc/pam.d/common-auth to run my script /usr/local/bin/movie

# here are the per-package modules (the "Primary" block)
auth    [success=2 default=ignore]  pam_unix.so nullok_secure
auth    [default=ignore]                pam_exec.so seteuid /usr/local/bin/movie

The script /usr/local/bin/movie is simply:

/usr/bin/mplayer /usr/local/movie.mp4

When entering password, I only get 0.1 s of black screen instead of the film.

How can I make my script working?

  • 1
    As in "Uh uh uh, you didn't say the magic word"? – Benjamin Dec 9 '16 at 18:18

To display within a gnome session, add DISPLAY=<display ID>. For instance:

DISPLAY=:0 /usr/bin/mplayer -fr /usr/local/movie.mp4
exit 0

with -fs for full screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.