I have a kid and I want to allow him to use the computer only after he solves a certain quiz at logon.
I can write a quiz application itself. What I don't know is how to set it up in the way, that computer doesn't show normal desktop until the quiz program decides so.
How can I do it? Should I use pam? But how can I make pam application interact with user graphically?
I use Ubuntu 14.04.
Here's a super simple way. Have your quiz program run during the Xsession, right before the desktop gets launched.
For example, try creating a file (as root) called
/etc/X11/Xsession/95quiz
with the following contents:Upon logging on, you will not be able to use the computer until the quiz program exits.
Of course, the way I have it setup, all users of the computer will be quizzed, which seems fair to me. Running it from only your kid's .xsession is left as an exercise for the reader. :-)