-
-
Save officialmofabs/b079b019875518791a6468fc497bd562 to your computer and use it in GitHub Desktop.
/etc/ssh/sshrc example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ip=`echo $SSH_CONNECTION | cut -d " " -f 1` | |
hostname=`hostname` | |
fqdn=`hostname -f` | |
logger -t ssh-wrapper $USER login from $ip | |
sendmail -t <<EOF | |
To: Alex <[email protected]> | |
From: ${hostname} <no-reply@${fqdn}> | |
Subject: SSH Login $USER from $ip | |
User $USER just logged in from $ip | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment