Question

I am trying to clone repo from bitbucket using ssh keys.

I generated the keys with ssh-keygen -t rsa the name i used was abc and abc.pub.

I was not able to connect then i tried debug ssh -v git@bitbucket.org

debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/vagrant/.ssh/id_rsa
debug1: Trying private key: /home/vagrant/.ssh/id_dsa
debug1: Trying private key: /home/vagrant/.ssh/id_ecdsa
debug1: Trying private key: /home/vagrant/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
vagrant@vagrant-ubuntu-trusty-64:~$ cd ~/.ssh

So from that i see that ssh only searches from key with name id_rsa

is that correct.

I remeber i had some other key name on my home computer and system was able to detect that.

I renamed abc to id_rsa and it worked

Was it helpful?

Solution

Try

ssh -v git@bitbucket.org -i /path/to/abc

Man Page says

-i identity_file  Selects a file from which the identity (private key) for public 
key authentication is read. The default is ~/.ssh/identity for protocol version 1,             
 and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/id_rsa for protocol version 2. 
Identity files may also be specified on a per-host basis in the configuration 
file. It is possible to have multiple -i options (and multiple identities 
specified in configuration files).  ssh will also try to load certificate 
information from the filename obtained by appending -cert.pub to identity 
filenames.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top