<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Morgan Nametbd</title>
  <link>https://stormerider.dreamwidth.org/</link>
  <description>Morgan Nametbd - Dreamwidth Studios</description>
  <lastBuildDate>Mon, 05 Aug 2013 04:24:54 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>stormerider</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/6411330/573632</url>
    <title>Morgan Nametbd</title>
    <link>https://stormerider.dreamwidth.org/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>https://stormerider.dreamwidth.org/190001.html</guid>
  <pubDate>Mon, 05 Aug 2013 04:24:54 GMT</pubDate>
  <title>Git with an alternate SSH key&amp;#8230;</title>
  <link>https://stormerider.dreamwidth.org/190001.html</link>
  <description>&lt;p&gt;So I use &lt;a href=&quot;http://bitbucket.org&quot;&gt;BitBucket.org&lt;/a&gt; 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&amp;#8230;)&lt;/p&gt;
&lt;p&gt;However, when I go to push to BitBucket for my personal use, I need to make sure that my SSH keys for work aren&amp;#8217;t loaded. This has resulted in me doing things like &amp;#8220;ssh-add -D&amp;#8221; 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.&lt;/p&gt;
&lt;p&gt;I came across a solution here: &lt;a href=&quot;http://noamlewis.wordpress.com/2013/01/24/git-admin-an-alias-for-running-git-commands-as-a-privileged-ssh-identity/&quot;&gt;git admin: An alias for running git commands as a privileged SSH identity&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, it didn&amp;#8217;t work for me. Took a bit to figure out why, but it came full circle back to the use of ssh-agent&amp;#8211; 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:&lt;/p&gt;

&lt;div style=&quot;bgcolor: #fff&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span&gt;#!/bin/bash&lt;/span&gt;
&lt;span&gt;set -e&lt;/span&gt;
&lt;span&gt;set -u&lt;/span&gt;
&amp;nbsp;
&lt;span&gt;unset SSH_AUTH_SOCK&lt;/span&gt;
&lt;span&gt;ssh -i $SSH_KEYFILE $@&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That did the trick for me. Hope that helps someone else out there as well!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=stormerider&amp;ditemid=190001&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://stormerider.dreamwidth.org/190001.html</comments>
  <category>ssh-agent</category>
  <category>git</category>
  <category>ssh</category>
  <category>bitbucket</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
