views:

266

answers:

2

I just bought a new computer and I am trying to clone my heroku project on it.

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.

>> sudo ssh-keygen
>> heroku keys:add
>> sudo git clone -o heroku [email protected]:myapp.git

Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
Permission denied (publickey).

Then I heard about doing it through ssh bash..

>ssh-agent bash
>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.

What? Ok Dad..

>>sudo chmod 700 ~/.ssh
>>ssh-agent bash
>>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:

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.

Any ideas?

UPDATE I went into my ~/.ssh file and performed ssh-keygen -t rsa and i made a new key called love. Then I heroku keys:add love.pub successfully.

Then I went to git clone..

sudo git clone -o heroku [email protected]:mysite.git

Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
Permission denied (publickey).

UPDATE 2

I deleted ~/.ssh, and recreated it without sudo. Then I removed all my keys I had created today off of heroku , and restarted the process.

Same error.

Update 3

>>heroku keys

  No Keys for this computer.

>>sudo heroku keys

  No Keys for this computer

>>heroku keys:add

>>heroku keys

ssh-rsa AAAA...J67lw== [email protected]

Compared these keys to my keys : They are identical. :D

Permission Denied.

Attempt 4

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 [email protected]:shwagr.git

Failed.

fatal: The remote end hung up unexpectedly

Huge Update

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.

A: 

you made a key for your sudo account, but not for your user account and you didn't sudo heroku keys:add so it uploaded the local user key not the sudo key, i'm guessing. Why would you want your local app in your home directory to have sudo permissions anyway? I would probably x the sudo and just do it as your user following this tutorial: http://docs.heroku.com/keys

Jed Schneider
it won't let me >>open love failed: Permission denied.Saving the key failed: love.
Trip
@Trip: see my comment on my answer for how to fix... you've borked this at this point and need to nuke it from space... it's the only way to be sure.
prodigitalson
i did and updated my asnwer. same problem. Is there a permissions purgatory?
Trip
+1  A: 
>> sudo ssh-keygen

NO. Drop the sudo. That will create keys for the root user, not your user. Well unless of course for some strange reason you want to use root. But then you need to prefix all related commands that are going to use this key with sudo.

prodigitalson
back up your ssh config: `mv ~/.ssh ~/ssh.bak` (use sudo if necessary since you may have inadvertently locked yourself out). then `ssh-keygen` again. if you have anything special set up in your `ssh.back/config` copy it back over to the newly generated one.
prodigitalson
since you just bought a new computer. restore it and dont use sudo, ever, unless you really really have to. use rvm and homebrew and stay local :) you are officially in permissions hell.
Jed Schneider
Id second what Jed says though i dont think you should abandon sudo, you should learn what it means and the implications and then use it when necessary. Also id recommend macports over homebrew, but its really a personal preference thing.
prodigitalson