0

I have a problem using ssh to connect to github.

I have a remote configured in my project, I see it using git remote -v.

When I execute the command git push origin master

The error is:

$ git push origin master
ERROR: Repository not found.
fatal: could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

How do I solve this problem?

Thanks a lot.

2
  • 1
    In future add error messages to the question as text not an image. What does git remote -v show? Commented Dec 18, 2015 at 10:37
  • We need the output of git remote -v ( If you wont show ups, just changes names etc and fake it, but we must know what appear ). Commented Dec 18, 2015 at 10:42

2 Answers 2

1

You need to add authentication keys to your git account.

Simply follow those steps and you will set up your ssh key in no time:

  • Generate a new ssh key (or skip this step if you already have a key)
    ssh-keygen -t rsa -C "your@email"

  • Once you have your key set in home/.ssh directory (or Users/<your user>.ssh under windows), open it and copy the content


Adding ssh key to github account?

  • Login to github account
  • Click on the rancher on the top right (Settings)
    github account settigns
  • Click on the SSH keys
    ssh key section
  • Click on the Add ssh key
    Add ssh key
  • Paste your key and save

And you all set to go :-)

Sign up to request clarification or add additional context in comments.

Comments

0

Step 1: Generate KEY

- cd   ~/.ssh

- ssh-keygen -t rsa -b 4096 -C "[email protected]"

NOTE - Keys need to be only readable by you:

chmod 400 ~/.ssh/id_rsa

If Keys need to be read-writable by you:

chmod 600 ~/.ssh/id_rsa

Step 2: Check the Contents and copy

- cat ~/.ssh/nameOfFile.pub | pbcopy

Step 3: Configure your SSH key into Bitbucket.org (similar applies to Github.com) GOTO settings => SSHKEY

- Add what you copied in Step 2 and give it a name

Step 4: Clone your repository using SSH protocol

- git clone [email protected]:{username}/repo.git

- git clone [email protected]:{username}/repo.git

This should work BUT

If you keep getting this error

[ Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights

]

Follow this steps.

i. ssh -T [email protected] OR ssh -T [email protected] depending on which you are using { This will attempt to create a connection to Bitbucket OR Github Cloud ).

ii. If you do not see a message similar  to (logged in as username.). Go to the next step

iii. ssh-add ~/.ssh/identity (identity is whatever name you saved the file when generating a key)

iv. You will get this message (Identity added: /path to ssh file/.ssh/mywork ([email protected])
v. You can now clone your repository.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.