I am generating ssh key, but the next day any pull,push,fetch is not working and getting below error:
Fetching origin git@bitbucket.org: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. error: Could not fetch origin
I am using below link to geneate token:
https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-linux/
Hi @Md Kamran and welcome to the community!
Your SSH key may be getting removed from the SSH agent on your machine and your SSH client may not be offering it when you try to pull, push or fetch the next day.
Do you have a file named config in the ~/.ssh directory on your machine? If not, you can create the directory and file, and then add the following content to the file:
Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/{ssh-key-name}
where {ssh-key-name} replace with the name of the private SSH key, whose public key you have uploaded to your Bitbucket account.
Please also note that the SSH key pair needs to exist in the ~/.ssh directory on your machine to work with this config. If the SSH key pair is in a different directory, please move it inside ~/.ssh.
If you are still facing issues after you follow these steps, could you please provide the following information so I can better help you?
GIT_SSH_COMMAND="ssh -vvv" <git command here>
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.