Skip to content

Instantly share code, notes, and snippets.

@JonathanMH
Last active December 16, 2015 15: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 JonathanMH/5459606 to your computer and use it in GitHub Desktop.
Save JonathanMH/5459606 to your computer and use it in GitHub Desktop.
short test if your ssh key file is added for use with git
#!/bin/bash
# to automatically add a key you can use the following:
mac_key_path='/Users/hb/.ssh/foobar'
linux_key_path='/home/username/.ssh/foobar'
# uncommend below
# ssh-add $mac_key_path
# ssh-add $linux_key_path
echo 'listing ssh-identities: '
ssh-add -l
echo ''
echo 'if your key did not show up, add them with'
echo '`ssh-add ~/.ssh/keyname`'
echo 'without the .pub, you will be prompted for a password'
echo 'for more info type'
echo '`ssh-add --help`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment