Add the following 2 lines at the bottom of the .bashrc file. Replace YOURUSERNAME with the shell login and replace YOUR@EMAIL.ADDRESS with a valid email address:
echo "Today is $(date) User is: `who | grep YOURUSERNAME | awk '{ print $6 }'`" > ~/lastuser.txt
mail -s 'user YOURUSERNAME logged into server XYZ' YOUR@EMAIL.ADDRESS < ~/lastuser.txt
Monday, January 26, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment