Skip to content

Instantly share code, notes, and snippets.

@zipizap
Last active December 28, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zipizap/7489927 to your computer and use it in GitHub Desktop.
Save zipizap/7489927 to your computer and use it in GitHub Desktop.
Detect ssh login from ~/.bashrc
# If you put this check inside ~/.bashrc you can detect bash session opened by ssh-logins :)
[ "$SSH_CONNECTION" -a "$SSH_TTY" == $(tty) ] && echo "This bash session was opened from an ssh login :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment