I am trying to setup 2 rails app on same server. First rails app is setup successfully. Now with second rails app, I am getting following issue:
repository access denied. deployment key is not associated with the requested repository.
I followed same steps to setup second rails app as first app. I created different ssh-key for second rails app repo on bitbucket, added that key as deployment key in second rails app's repo. Even when I tried
ssh -T git@bitbucket.org
it shows me message following message:
authenticated via a deploy key.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
But when I am trying to deploy my rails app via Capistrano, it's just not allowing that and throwing that first error. I am able to clone the repo on server with proper command, but not able to access it via capistrano deploy.
Can someone let me know what is wrong here? Again, I followed same steps as I followed for my first rails app.
Any help or suggestion would be highly appreciated.
You can use the same deployment key on multiple different repositories.
If you'd prefer to keep separate keys for each, though, then you'll need to use the ssh config file to set separate aliases for each:
Host bitbucket-repoA
Host bitbucket.org
IdentityFile /path/to/first/key
Host bitbucket-repoB
Host bitbucket.org
IdentityFile /path/to/second/key
Once that's done, you'll need to adjust the remote URL on each repository to refer to either "bitbucket-repoA" or "bitbucket-repoB" (or whatever you chose to name the two aliases) instead of bitbucket.org. That will ensure that SSH uses the correct private key to connect.
Thanks @jredmond!
I wasn't aware that I could use same deployment key for multiple different repositories. I used same deployment key for that 2nd repo and it worked.
Thanks for the help! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying to access the repository with edit permissions via ssh. I've added the ssh key to my account, but I'm getting the same error above. Am I missing to setup something on my profile in order to use ssh keys as usual?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Access keys are read-only, by design. If you want to be able to write then you need to add the key to your account.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.