Root login warning

Edit /root/.bash_profile

isRootLoggedIn=`who |grep root |awk '{print $1}'`

if [ "$isRootLoggedIn" = "root" ]; then
echo "ROOT logged into `hostname -s` on `date` was this expected?" |mail -s "ROOT logged in" noc@company.com
fi

rb/rootloginwarning.txt · Last modified: 11/07/2019 17:23 by andrew