Bitbucket has error after git push
Problem: Warning message
Warning: Permanently added ‘bitbucket.org,18.205.93.0’ (RSA) to the list of known hosts. git@bitbucket.org: Permission denied (publickey).
while executing git push command.
Solution: We necessary right configure SSH keys.
Step 1. Go to home user directory (usually, it available after successfully ssh connected) and check the availability file id_rsa.pub located to /home/username/.ssh/ . If file exist go to step 2, else creating an ssh pair for user authentication use command:
ssh-keygen
Step 2. Copy content the file id_rsa.pub and paste to Bitbucket Settings - SSH Keys - Add key
vi /home/username/.ssh/id_rsa.pub
Step 3. Add your SSH private key to the ssh-agent:
ssh-add -l
Step 4. Check configure file setup:
vi /home/username/.ssh/config
it must have next contain:
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa.pub
Step 5. Connect via SSH directly:
ssh -Tvv git@bitbucket.org