Login test to ensure "su" for security - HP-UX
(note: developed on HP-UX, retyped, syntax may have minor errors)
# Test to see if the user logging in is trying to use a restricted
# account and if they are, log them out. Developed 06/18/1997
# author: john meister
#
case `/usr/bin/who am i | awk '{ print $1 }'`in
phredrick) if['/usr/bin/who am i | awk '{ print $1 }'`=`/user/bin/whoami`]
then
echo "###################"
echo " Please log in as an authorized user."
echo "###################"
/usr/bin/sleep 4
exit;exit
fi;;
infouser) if[`/usr/bin/who am i | awk '{ print $1 }'`=`/usr/bin/whomai`]
then
echo "###################"
echo " Please log in as an authorized user."
echo "###################"
/usr/bin/sleep 4
exit;exit
fi;;
esac
|