Git rejected permission masterku master

I follow ruby.railstutorial. I run the command "git push heroku master" and spit out this error.

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

I enter my rails application "/ Users / lexi87 / rails_projects / first_app". Any solutions?

+50
git ruby-on-rails heroku
Jan 15 '13 at 16:46
source share
7 answers

The best way to avoid such errors is to use one pair of public and private keys, rather than an additional key for the hero. Thus, you (or your system) cannot select the wrong key to enter the hero.

If you get this error, you did something wrong. Check out this site: https://devcenter.heroku.com/articles/keys

If you pointed out this error, the best way is to remove the unnecessary keys and use only one.

If you need more than one key pair in your system, you can install one key for geroku. This is done using the following command:

 heroku keys:add 
+65
Jan 15 '13 at 18:06
source share
— -

Some help for Windows 7 users with the Github Windows client installed:

Even though the story of the hero tells that he found his public key git_hub and downloaded it, "git push heroku master" failed. After completing the following steps, it works fine.

  • Create a .ssh folder in the user folder if it does not exist. If it deletes all the files in it (this assumes that everything is in order, starting from scratch using ssh keys).

  • In Windows Explorer, right-click .ssh and select Git bash from the context menu. It is installed with the Github Windows client software.

  • In the bash window, enter ssh-keygen -t rsa -C "yourname@email.com " When prompted, enter passphrase (do not lose it).

  • Close the bash shell window.

  • At the cmd prompt of your project root, enter heroku keys:add . This will find and load the key that you just created from your /.ssh file in Heroku.

Now you can enter git push heroku master to push the application to Heroku. Note. If necessary, you will need to add your newly opened ssh public key to your Github account.

+13
Mar 24 '14 at 11:47
source share

I ran into the same problem. In my .ssh folder, I had a file called Famous Hosts. I kept trying to delete and create new ssh keys that it did not work. In the end, I just deleted everything in .ssh, including "Famous Hosts", and then created a new rsa key using:

 ssh-keygen -t rsa 

then I added this new key to the hero using:

 heroku keys:add 

then create a new gekuu repo and pushed my application to it:

 heroku create git push heroku master 
+8
Nov 02 '13 at
source share
 ssh-keygen -t rsa 

The above is optional, as you can also reference an existing key. Heroku will offer to choose a key in the next step.

 heroku keys:add 

Add your newly created key or existing one. If you still encounter a problem, you will most likely need to add the key to your list of ssh machines by doing the following:

 ssh-add ~/.ssh/name_of_your_rsa 

and confirm that your ssh is added

 ssh-add -l 

This will allow you to access the Heroku remote repository.

+4
May 8 '14 at 2:23
source share

on OSX, I had the same problem, I was getting

 no such identity: /Users/me/.ssh/yourPrivateKey: No such file or directory Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

I tried to create a new key using ssh-keygen -t rsa and then add it using heroku: add keys, but that didn't help.

Then I found a file called config in ~ / .ssh /, and inside the file:

 ServerAliveInterval 300 ServerAliveCountMax 3 host heroku.com user git hostname heroku.com identityfile ~/.ssh/yourPrivateKey 

So, I changed yourPrivateKey to my private key file name (default id_rsa) aaand it worked :)

+2
Sep 01 '14 at 20:19
source share

I created a key with

 ssh-keygen -t rsa 

and used a different file name than id_rsa (in my case heroku). I added a key to the hero using

 heroku keys:add 

When I tried to press my main branch on the hero, I always received the following error:

$ git push hero master
Host Authentication heroku.com
(50.19.85.132) 'cannot be installed. The fingerprint of the RSA key is 8b: 48: 5e: 67: 0e: s9: 16: 47: 32: 99: 87: 0c: 1f: s8: 60: bb. Are you sure you want to continue the connection (yes / no)? Yes Warning: Constantly adding 'heroku.com, 50.19.85.132' (RSA) to the list of known hosts. Resolution
denied (publish). fatal: Failed to read from remote repository.

Please make sure that you have the correct permissions and the repository exists.

As I noticed, git only used my id_rsa key from another ssh-access (you can check this with git gui: Help -> SSH keys).

I renamed my .ssh directory C: \ Users \% username% .ssh to .ssh.bak and copied mykkku private and public key (from the .ssh.bak directory) to the newly created .ssh directory and named it id_rsa (and id_rsa .pub).

Now clicking works as expected:

 git push heroku master 
0
Mar 23 '14 at 15:57
source share

If you are running Windows, be sure to use git - bash instead of Powershell / Command Prompt.

If you just want to reset your ssh keys:

  • delete user .ssh dir
  • open git - bash
  • ssh-keygen -t rsa
  • hero keys: add

and then you can git click.

0
Oct 13 '14 at 9:31
source share



All Articles