Unable to push repo using bitbucket in CentOS 7

Problem: try to use git to push my repo in CentOS 7. But pop up below error message:

fatal: Could not read from remote repository.

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

Solution: Go to Bitbucket panel, go to the SSH keys page in Personal Setting (not repo setting) and add the public key content.

Then upload the private key to your CentOS 7 server and enter below command:

eval `ssh-agent`
ssh-add <private_key_file>

remember the key file permission (600), and if you don’t want to run above command every time you log in. you can run ssh-agent on the background.

eval $(ssh-agent -s)

then enter below command --

ssh -T [email protected]

above command is to verify your configuration and Bitbucket username. If you see below message then you can start to push your repo.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

You can push your code using

git push

You may also like...