First check if have set up ssh-keygen Or set up with this command

$ssh-keygen

Test connection

ssh -T git@bitbucket.org

Then Check if ssh-Agent is working

ssh-add -l

If not then start with this command

eval `ssh-agent -s`

Now get you .pub create file in ssh-keygen process and paste content in but bucket

Ref:

confluence.atlassian.com