Skip to content

Just a simple script to notify by email of some login on the SSH server.

License

Notifications You must be signed in to change notification settings

lucagasperini/SSH-login-send-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

SSH-login-send-mail

Just a simple script to notify by email of some login on the SSH server.

How install

The dependencies are geoiplookup, s-nail, systemd, pam so make sure you have those.

If you are on Debian: apt install geoip-bin geoip-database s-nail

Download the script and place it on /opt/ssh-login-send-mail.sh then configure it with your SMTP parameters then

chown root:root /opt/ssh-login-send-mail.sh && chmod 700 /opt/ssh-login-send-mail.sh

Then edit the pam configuration at /etc/pam.d/sshd adding the following row in @include common-session

session optional pam_exec.so seteuid /opt/ssh-login-send-mail.sh

How use

Just login in your SSH server :D

You can just find some output in systemd, for example:

journalctl --since "10 minute ago" | grep "ssh-login-send-mail"

About

Just a simple script to notify by email of some login on the SSH server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages