Skip to content

Instantly share code, notes, and snippets.

@sajith
Created February 14, 2018 00:19
Show Gist options
  • Save sajith/e71061bde64e7d23ea35268dd720781b to your computer and use it in GitHub Desktop.
Save sajith/e71061bde64e7d23ea35268dd720781b to your computer and use it in GitHub Desktop.
#! /bin/bash
# Stick this in ~/.bashrc or ~/.bash_profile:
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval $(ssh-agent -s)
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment