Skip to content

Instantly share code, notes, and snippets.

@wikrie
Created October 11, 2016 08:43
Show Gist options
  • Save wikrie/d39bb7b193f7abe4f84b405d34ef99d2 to your computer and use it in GitHub Desktop.
Save wikrie/d39bb7b193f7abe4f84b405d34ef99d2 to your computer and use it in GitHub Desktop.
Send Notification if User login via SSH
#!/bin/bash
#echo "Login detected at $(hostname) / $(date +%d.%m.%Y) $(date +%H:%M:%S)"
#FROM=`echo $SSH_CONNECTION | awk '{ print $1 }'`
#echo "Benutzer: $USER@$FROM"
#echo
#echo -n "Uptime: "
#uptime
#echo
#echo "Last Login Activity: "
#last
#echo
#echo "Logged in Users: "
#finger
echo "Login auf $(hostname) am $(date +%Y-%m-%d) um $(date +%H:%M)"
echo "Benutzer: $USER"
echo
finger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment