Skip to content

xawos/telepam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TelePAM

TelePAM is a little unicorn that sends you messages when someone opens a new session in your Linux machine through PAM's pam_exec.

Instructions

  1. Follow this instructions to create a Telegram bot and this to get your ID.
  2. Clone the repo and enter its folder.
  3. Add the following line at the end of the file /etc/pam.d/common-session:
  • session optional pam_exec.so /usr/bin/pam_login.sh
  1. Change file pam_login.py with your id and token
  2. Place the files pam_login.[py,sh] in /usr/bin mv pam_login.* /usr/bin/
  3. pip3 install telebot

If everything goes correctly at the next login you will receive a message to your bot similar to: alt text Remember to send a message to the bot before setting this up, or Telegram will reject the request.

For any debugging purposes change the line we added in /etc/pam.d/common-session to:

  • session optional pam_exec.so debug log=/tmp/pam_exec.log /usr/bin/pam_login.sh
  • You'll have a file in /tmp/pam_exec.log with pam_exec's output to guide you in troubleshooting

The idea started while playing with PAM for reasons that i do not recall because: alt text

About

Telegram Bot to notify PAM login in Linux systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published