I am not able to clone my repository to my remote EC2 ubuntu instance using my deployment key. Here are the steps I followed.
- I deleted the existing deployment keys I had in my bitbucket account
- I cleaned ~/.ssh/know_hostsfollowing https://stackoverflow.com/a/26520681/808734
- I generated my new key following these steps and added it as a deployment key to the repo.
- Here is the output of - ssh -T git@bitbucket.org- You can use git or hg to connect to Bitbucket. Shell access is disabled. This deploy key has read access to the following repositories: username/repository: KEYNAME -- email@gmail.com
- But when I try to clone the repository 
 - sudo git clone git@bitbucket.org:username/repository.gitI get the following error- Cloning into 'repository'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Am I missing something here? Anybody has any advice?
Thanks for reading.
 
     
    