title: git clone heroku ssh permission denied
body: <p>I just bought a new computer and I am trying to clone my heroku project on it.</p>
  
  <p>Here's what I've done so far. I didn't include the trace, but everything was saved in the right place, and the functions ran without errors.</p>
  
  <pre><code>&gt;&gt; sudo ssh-keygen
  &gt;&gt; heroku keys:add
  &gt;&gt; sudo git clone -o heroku git@heroku.com:myapp.git
  
  Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
  Permission denied (publickey).
  </code></pre>
  
  <p>Then I heard about doing it through ssh bash..</p>
  
  <pre><code>&gt;ssh-agent bash
  &gt;ssh-add ~/.ssh
  
  Permissions 0777 for '/Users/macuser/.ssh' are too open.
  It is recommended that your private key files are NOT accessible by others.
  This private key will be ignored.
  </code></pre>
  
  <p>What? Ok Dad.. </p>
  
  <pre><code>&gt;&gt;sudo chmod 700 ~/.ssh
  &gt;&gt;ssh-agent bash
  &gt;&gt;ssh-add ~/.ssh
  Enter passphrase for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh: 
  Bad passphrase, try again for /Users/macuser/.ssh:
  </code></pre>
  
  <p>Not sure what the password here is, but it sure wasn't me who set this one. If I simply press return/enter, it exits out, but that doesn't give me the impression it worked. And consequentially, it still doesn't allow me to clone the repository.</p>
  
  <p>Any ideas?</p>
  
  <p><b>UPDATE</b>
  I went into my ~/.ssh file and performed <code>ssh-keygen -t rsa</code> and i made a new key called <code>love</code>. Then I <code>heroku keys:add love.pub</code> successfully.</p>
  
  <p>Then I went to git clone..</p>
  
  <pre><code>sudo git clone -o heroku git@heroku.com:mysite.git
  
  Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
  Permission denied (publickey).
  </code></pre>
  
  <p><b>UPDATE 2</b></p>
  
  <p>I deleted ~/.ssh, and recreated it without <code>sudo</code>. Then I removed all my keys I had created today off of heroku , and restarted the process.</p>
  
  <p>Same error.</p>
  
  <p><b>Update 3</b></p>
  
  <pre><code>&gt;&gt;heroku keys
  
    No Keys for this computer.
  
  &gt;&gt;sudo heroku keys
  
    No Keys for this computer
  
  &gt;&gt;heroku keys:add
  
  &gt;&gt;heroku keys
  
  ssh-rsa AAAA...J67lw== macuser@Mac-Users-MacBook-Pro.local
  </code></pre>
  
  <p>Compared these keys to my keys : They are identical. :D</p>
  
  <p>Permission Denied.</p>
  
  <p><b>Attempt 4</b></p>
  
  <blockquote>
    <blockquote>
      <p>heroku keys:clear
      rm -rf ~/.ssh
      mkdir ~/.ssh
      cd ~/.ssh
      ssh-keygen -t rsa
      heroku keys:add
      cd /Users/macuser/Sites/
      sudo git clone -o heroku git@heroku.com:shwagr.git</p>
    </blockquote>
  </blockquote>
  
  <p>Failed.</p>
  
  <p>fatal: The remote end hung up unexpectedly</p>
  
  <p><b> Huge Update </b></p>
  
  <p>Just found out that git repo is actually empty. And it's just a symbolic link ( when you attach a real domain to it it still uses the old one as the real repo ). So when I pulled one of Heroku's default names like smooth-buttery-back-52.git , it pulled and worked, and was actually my repository. </p>