Back to blog

Pushover notifications for SSH logins

February 23, 2016 - Posted in General Posted by:

Curious to know when a user logs into your server successfully via SSH? Using Pushover notifications you can have something like this.


Fortunately, tying together PAM and Pushover is painless.

Log into Pushover and register an application. Spruce things up with a relevant icon and make note of the application’s API token and your user key.

Next, grab this small script and place it somewhere on the server. I put mine here, /etc/ssh/ Edit the script and insert your API token and user key like so,

Make sure the script is executable
chmod +x /etc/ssh/

Add the following line to /etc/pam.d/sshd
# Notify Pushover on successful login
session optional seteuid /etc/ssh/

Upon next successful login your Pushover client should be greeted with a nice notification. Also, since this is a PAM configuration, with minimal modification you could extend this to samba, sudo, etc.

Leave a Reply

Your email address will not be published. Required fields are marked *