One way is to wrap the login in a shell script.
something like:
#!/bin/sh
UEXIT() {
echo -e "\033[40;32m , Want to go???"
echo "yes|no" ; sleep 2s
read ans
case $ans in
YES|yes|Yes|y) exit > /dev/null 2>&1
;;
NO|no|No|n) return ;;
esac
}
#traps common escape signals with function choice
trap "UEXIT" 2 3 15
menu() {
echo "
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
USER MENU
1) Change Password A
2) Change Password B
3) Do something else
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo -n "your choice: "
read choice
case $choice in
1) Changepass commands ;;
2) Changepass commands ;;
3) Do something else commands ;;
esac
exit
}
Then put this in the users .profile.
In theory something like this will work, but your mileage
may vary.
For more control use something like an expect script to wrap the login, or use a RestrictedShell, or trap the user in their home directory, either through permissions or silly shell tricks.
Good luck, hope this helped.