I load a script in .bash_profile and this script will ask for right password whenever a user opens a terminal window. If the user enters a wrong code, the script will run
if [ code = "980425" ]; then
You can always trap
trap 'echo got SIGINT' SIGINT
Once you're done, reinstall the default handler again with
See the POSIX spec for trap for details. This works in all Bourne shells, not just bash.