This quick tutorial will show you how to get email alerts when any user logs into your Linux box.
Sending emails from command line
This will allow you to send emails from command line.
Install ssmtp
Edit the config file to set your usr/pwd/server/etc
Example for how gmail setup would be
Test that everythings is working. This should send email to the provided email and a body of test
Setup the auto send
There are a few places you can add the command below to send a mail on user login. I just use /etc/profile. If you have better location please leave comment.
Add the following to bottom of file
Bonus
If you have crontab jobs they will now be sending emails. Add the following line to the crontab
Edit crontab
Add to the top of the file