Skip to content

frontdevops/ssh-telegram-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssh-telegram-alert

Telegram notifications about ssh authorization on the server

  1. First you need to create a telegram bot via https://t.me/BotFather
  2. Then create a private (or not, as you prefer) channel for alerts
  3. Create a URI as follows:
https://api.telegram.org/bot*****:***-*****************/getUpdates

and invoke it

  1. Add your bot to the channel
  2. Get channel ID from https://api.telegram.org/bot*****:***-*****************/getUpdates

  1. Register at https://ipinfo.io/ and get an API token
  2. Fill in the variables in the script
  3. chown +x ssh-alert.sh
  4. Call the script and check that everything works correctly
  5. vi /etc/pam.d/sshd and enter at the end of the file
session optional pam_exec.so type=open_session seteuid /full/path/to/ssh-alert.sh

Try connecting to the server via ssh and enjoy your notification system

About

Telegram notifications about ssh authorization on the server

Resources

License

Stars

11 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages