Skip to content

Instantly share code, notes, and snippets.

@icedraco
Created January 26, 2017 22:23
Show Gist options
  • Save icedraco/0109f8d6b540821e84453f06dfc59e68 to your computer and use it in GitHub Desktop.
Save icedraco/0109f8d6b540821e84453f06dfc59e68 to your computer and use it in GitHub Desktop.
SSHRC file to notify via telegram script of a new login
#!/bin/bash
# /etc/ssh/sshrc
TELEGRAM=$HOME/bin/telegram
HOST=$(hostname)
DATE=$(date)
MSG="SSH Login: *$USER@$HOST*
Conn: *$SSH_CONNECTION*
Date: $DATE"
$TELEGRAM "$MSG" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment