Skip to content

Instantly share code, notes, and snippets.

@t-buss
Created February 13, 2018 15:34
Show Gist options
  • Save t-buss/f0fe1b52cd504dceae51a486e2f440c8 to your computer and use it in GitHub Desktop.
Save t-buss/f0fe1b52cd504dceae51a486e2f440c8 to your computer and use it in GitHub Desktop.
Code to send a desktop notification when someone logs into your computer via SSH
if [[ $SSH_CONNECTION ]]; then
notify-send "Incoming SSH connection from `who | tail -n 1 | cut -d'(' -f2 | cut -d')' -f1`"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment