I'm new to SSH. I'm working my way through the BitBucket tutorial "Set up SSH for Git":
https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git
I'm at step 6.9:
Return to the terminal window and verify your configuration by entering the following command
ssh -T git@bitbucket.org
I get the error:
The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established. RSA key fingerprint is ....
I would be grateful for any advice.
.
This is actually normal. It’s not actually an SSH error. The Atlassian people really should have documented that this will probably happen in their instructions. Omitting it is bad on their part.
What’s happening is that SSH is being cautious. That’s part of being secure. Whenever SSH tries to log in to a host it hasn’t seen before, it will put up a message like this.
You didn’t paste in the whole message. It looks like this:
$ ssh -oUserKnownHostsFile=/dev/null -T git@bitbucket.org The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established. RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40. Are you sure you want to continue connecting (yes/no)?
SSH is saying “I haven’t seen this host before. It has this IP. It identifies itself with this fingerprint. Do you really want to connect?” And in really secure environments, you’d actually compare the fingerprint with the fingerprint that you had been given before to make sure you’re not connecting with an imposter host.
In this particular case, you don’t have any other fingerprint to compare it to. But you really are trying to connect to bitbucket.org. So you can go ahead and say “yes” and you should continue logging in.
SSH will also save the hostname and fingerprint in the ~/.ssh/known_hosts file. The next time you try to log in, it will see that you’ve connected to bitbucket.orgbefore, and bitbucket.org(presumably) has the same fingerprint, so it won’t put up that message again.
The security comes in in case some bad guy tries to impersonate bitbucket.org. Since forging fingerprints is really hard, he likely won’t be able to impersonate that, so when you try to log in to the bad site, you’ll get a message like this:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is ff:ff:ff:f2:6f:14:6b:5c:3b:ec:aa:46:46:ff:ff:ff. Please contact your system administrator. Add correct host key in ~/.ssh/known_hosts to get rid of this message. Offending key in ~/.ssh/known_hosts:1 RSA host key for bitbucket.org has changed and you have requested strict checking. Host key verification failed.
Now, that’s an error.
Wow! Thanks for v. detailed response. All OK now. (Not sure if "Thanks" is permitted on this forum. If so - I can delete it.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much!
That's really helped me!
So I just needed to continue with YES option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very useful answer and well explained. Thank you so much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes it's Very helpful, thank you sir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same problem, and thank you sir!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
same problem. thanks for sharing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for saving me from connecting to the wrong tunnel with your detailed answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks a lot for the explanation!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you can go ahead and say “yes” and you should continue logging in.
@CEDRIC ZABEL I have same issue, but when i say "yes" it's answer me like:
<my_repository>@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
I dont have any SSH in my repository (i tying made some, bat didn't use it and deleted). Just trying clone my data from bitbucket to new location (new pc)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The permissions of our ~/.ssh directory had been set to 600, as this was a directory containing .known_hosts, these permissions meant no files could be read in the directory (due to the lack of "x"). Setting ~/.ssh to 700 fixes the issue.
You want the permissions to be:
.ssh
directory: 700 (drwx------)$ chmod 700 ~/.ssh
id_rsa
): 600 (-rw-------)$ chmod 600 ~/.ssh/*
.pub
file): 644 (-rw-r--r--)$ chmod 644 ~/.ssh/*.pub
Settings other than the above will create errors when git is trying to connect to the origin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for saving me from connecting to the wrong tunnel with your detailed answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
same problem. thanks for sharing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also please make sure that you have added the SSH Key in your bitbucket account under settings. I had a similar message migrating from GitHub to bitbucket.
btw, here is an an updated link the last one is down
https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.