Skip to content

Bash script to send PushOver notifications when someone logs in via SSH.

Notifications You must be signed in to change notification settings

Anti-Apple4life/ssh-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ssh-notify

This is a heavily modified version of cmaster11's SSH notifier, which he posted to Medium.com. His script was made to work with Notify17, which, at least for me, was inoperative. This version works with PushOver, which is still active.

Instructions

Clone the repository

Create a PushOver account if you do not have one already

Create a new application. Choose a name that you will remember, upload a logo (If you want to), agree to the Terms of Service and the Guide to being friendly to the API.

Your application is now created! Copy the API key and replace YOUR_PUSHOVER_APP_TOKEN in the script with your application key.

Go back to your PushOver homepage and copy your user key. Replace YOUR_PUSHOVER_USER_TOKEN with your user key.

If you would like to whitelist your username from alerts, replace YOUR_USERNAME with your linux username. Otherwise, remove that entire if statement.

Edit the /etc/pam.d/sshd file and append the following line at the end: session [default=ignore] pam_exec.so /bin/bash /opt/ssh-notify.sh

Disclaimer

This has only been tested on Arch Linux, but it will most likely work on other linux distros. Test on Mac and Windows at your own risk.

About

Bash script to send PushOver notifications when someone logs in via SSH.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages