ssh-login-notify
! This project is not intended to replace other security measures such as public keys! !
This project should make it possible to quickly identify SSH logins that may not have come from you, by sending a notification to your cell phone. In the config you can set your region/city/IP. For all logins that do not match the data set in the config, a notification is sent to the mobile phone via webhook.
Installation:
- Install MacroDroid on your mobile phone
- Import Macro: https://github.com/Suqatri/ssh-login-notify/blob/main/marco/SSH_Server_Login.macro
- Log into your server and upload the jar (e.g. to the directory /home/ssh-notify)
- Open .bashrc (e.g. nano ~/.bashrc)
- Add following lines (! Important: Adjust the path of your jar !):
# # Send notification to mobile phone, if there is a weird login... # if [ -n "$SSH_TTY" ]; then USERNAME=$(whoami) IP_ADDRESS=$(who -u am i | awk '{print $NF}') java -jar /home/ssh-notify/ssh-login-notify.jar "$USERNAME" "$IP_ADDRESS" fi
- Start the jar manuelly with java to create the default config.json
- Edit the config.json
- Now logins should be reported according to the config