Aug. 5th, 2013

stormerider: Apple Xcode icon (Coding - OSX)

So I use BitBucket.org both for my day job, and also for managing my private Git repos. (Since BB is free for personal private repo use, whereas GitHub charges for that…)

However, when I go to push to BitBucket for my personal use, I need to make sure that my SSH keys for work aren’t loaded. This has resulted in me doing things like “ssh-add -D” to wipe out all the keys in my ssh agent, then manually loading my personal key for git use. Then when I start work again, I have to reload my other keys. Rather annoying.

I came across a solution here: git admin: An alias for running git commands as a privileged SSH identity

However, it didn’t work for me. Took a bit to figure out why, but it came full circle back to the use of ssh-agent– even though I was properly specifying my SSH identity file, the keys from my ssh-agent were being seen first. All I had to do was to disable the use of ssh-agent inside of the ssh-as.sh script, like so:

#!/bin/bash
set -e
set -u
 
unset SSH_AUTH_SOCK
ssh -i $SSH_KEYFILE $@

That did the trick for me. Hope that helps someone else out there as well!

Profile

stormerider: (Default)
Morgan Nametbd

June 2015

S M T W T F S
 123456
78910111213
14151617181920
212223 24252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 19th, 2017 12:59 pm
Powered by Dreamwidth Studios