SSH登入自動傳送通知

. . . .
.

[email protected]:~$ nano /etc/ssh/sshrc

ip=`echo $SSH_CONNECTION | cut -d " " -f 1`

logger -t ssh-wrapper $USER login from $ip
echo "User $USER just logged in from $ip" | sendemail -f <source email> -t <target email> -s <smtp server ip> -xu <username> -xp <password> -u <tittle> -m <message> &






COMMENTS
Login to continue.
User
nano /etc/ssh/sshrc