Reputation: 77
I've tried everything I can think of and I still keep getting this error:
My Steps:
1) Generate local key to ~/.ssh
2) Copy that key to BitBucket SSH keys for my profile.
3) Added that key to my server at ~/.ssh
Is there something else I'm supposed to do? I am just doing a git clone repo(SSH)
Upvotes: 0
Views: 3712
Reputation: 24458
First of all, SSH is quite picky about your file and directory permissions. Double check that your .ssh
directory is chmod 700
, your key is in a file called id_rsa
which is chmod 600
, and that both of these are owned by you.
Secondly, is there an ssh-agent running? ssh-agent
is a service that can cache your credentials so you don't have to type your password every time you fetch and push, with timeouts and so on if you want them. ssh
(and therefore git
) will ask your agent for your key if it's running.
To add a key to the agent, use ssh-add
. If your key isn't in a file called id_rsa
, you can also add it by explicit path: ssh-add ~/.ssh/my_other_rsa
. Once keys have been added, you should be able to see their fingerprints listed in the output of ssh-add -l
.
If you aren't running an agent (you'll see "Could not open a connection to your authentication agent.
") then it may help to start one with ssh-agent bash
(then add your keys). If that works, you can use some shell tricks to automatically start one for each session on your server.
Upvotes: 2