News for hackers. Stuff that matters.
Re:Posting successful SSH logins to Slack by lazyant on Friday January 22, 2016 @11:43AM (#10953775)
If you want to send email on login, add in /etc/profile :

echo "`whoami` logged in at `date` from `echo $SSH_CLIENT`" | mail -s "`hostname` login" [email protected]

Note that people can still ssh execute remotely etc.

Re:Posting successful SSH logins to Slack by mscman on Friday January 22, 2016 @11:49AM (#10953820)
You'll definitely want to add a '&' at the end of that line so that you don't delay user logins if the network is down or mail barfs.
Re:Posting successful SSH logins to Slack by lazyant on Friday January 22, 2016 @12:29PM (#10954152)
right, actually I do have a delay in a server with no mail where it fails :-)
Re:Posting successful SSH logins to Slack by taylorhughes on Friday January 22, 2016 @12:26PM (#10954131)
pam_exec seems to be a more robust solution to login notifications than /etc/profile http://blog.stalkr.net/2010/11/login-notifications-pamexec-s...