In a brand new installation of SourceTree on a brand new WIndows 10 I am getting and error for push/pull/fetch etc :
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 aa:d1:aa:00:bb:c0:b0:a0:d0:e0:f0:a0:a1:00:11:ee
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
A solution to this is described here:
But this does not resolve the problem. The solution offers two workarounds:
1) "Just get SourceTree to use Embedded Git and get it to trust the host"
When I do this I am not prompted to trust the host. It simply switches to Embedded without any more messages or confirmations.
2) Run the command
"C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" bitbucket.org
When I do this, I am indeed prompted to trust the server. After I enter yes, I am prompted for a login. I have no idea what to enter here. But any login I can imagine, such as for my bitbucket account fails :
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
BTW, the command line versions of the git commands work fine
Any help in this matter would be appreciated.
I was able to fix this in Windows 11 by running the following code in the command line (Sourcetree is installed in a different location than most programs by default apparently):
"C:\Users\username\AppData\Local\SourceTree\app-3.4.8\tools\putty\plink.exe" bitbucket.org
Change "username" to your PC username, and change "app-3.4.8" to the appropriate folder with your version of sourcetree.
Then you'll get this:
The server's host key is not cached. You have no guarantee
that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 SHA256:[removed - but this will show your rsa key]
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n, Return cancels connection, i for more info)
Type y and click enter.
Then when it prompts for your login,
login as:
...enter your bitbucket username and press enter.
I got this response (and pressed enter),
Access granted. Press Return to begin session.
Server refused to allocate pty
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
...and was able to clone just fine after that.
Thank you very much. I have been banging my head for several hours with this problem. Two things that were different for me:
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes! Lets go Rachel!
I have been looking for that tools folder in my Sourcetree app for a full day now. If you are reading this with version 3.4.8 installed the article above not longer applies to you. you will need to use Rachel's instructions instead.
Thank a bunch Rachel!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks from Japan! I could resolve the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Feito!!
Muito obrigado. Funcionou aqui
Thanks from Brazil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wanted to add an update because I recently tried to my repo for Sourcetree in a Parallels virtual machine, and got the same error that this person was mentioning above:
FATAL ERROR: No supported authentication methods available (server sent: publickey)
I decided to try using OpenSSH instead of Putty, and that fixed the issue. To do that, just follow the instructions under "Set up SSH for Git on Windows" at this link:
Set up an SSH key | Bitbucket Cloud | Atlassian Support
Note that you'll need to install Git for Windows if you want to run the commands outside of Sourcetree:
Git for Windows
After you've setup an ssh key with those instructions and verified the configuration, open sourcetree and go to Tools>Options. Under the "General" tab select "OpenSSH" for the SSH client. You can then browse for your ssh key, which should be in:
C:\Users\username\.ssh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey!
I saw this answer right after solving the issue the exact same way. Thank you very much for posting it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also had the same issue :(
Just running the "plink.exe" program, and answering "y" to adding to the cache, was enough to unblock Sourcetree :) I didn't need to log in or anything (I'd already set up my ssh key & other info in SourceTree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for posting this solved my problem!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Switching to OpenSSH worked for me.
Thanks from India!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is better to switch to open ssh. Much simpler to use. You can do that going to Tools > Options > General then change SSH Client to OpenSSH.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked. Thanks :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same error -- installing putty also fixes this fatal error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Thank you so much, I've been trying to figure this out for several days <3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks !!!!!!!!!!!! <3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, y'all!
If anyone in 2022 is getting this exact issue, I found another way that fixed it for me. I had the same scenario as the poster (Fresh Windows 11 installation) and I couldn't clone any repos
So this is what I did
1. Open SourceTree and navigate to Tools > Options > Authentication
2. Click on your account and click "Set as default" (Rest Saved Passwords & Git Saved Passwords will appear)
3. Delete everything (starting from the bottom, deleting Account last)
4. Restart SourceTree and go back to Authentication and add your account again
Now, the cache prompt will properly appear while fetching your private key.
This method may not work for everyone but it did for me š
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!!! Work's for me š
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Changed the SSH client from Putty to OpenSSH will work. you can go there Tools -> General ->SSH Client
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's work for me ,think you very much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bump
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me and is by far the easiest, least destructive solution.
I would suggest everyone tries this first, before deleting accounts etc, as suggested in a previous solution:
Thanks very much. š
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked for me too! Thank you very much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For others that may be having the issue, this is how I was able to get past it.
I was able to correct this by downloading and installing putty onto my windows 10 laptop. I then made a connection to my git server and answered the question with a yes.
Marv
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. You save my day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks too !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked for me, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The solution didn't help me at all. It turned out all I needed to do was switch my SourceTree ssh client from Putty/Plink to OpenSSH and it immediately found my usual SSH key that I use for connecting to Github, and I was able to push from sourcetree etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also another working solution (September/2022):
if you were using a ssh key previously generated with "ssh-keygen", for example and that key
exists at path "C:\Users\<username>\.ssh", you can import that key with PuTTy, and it will work.
Click Tools > Create or Import SSH Keys,
then click "Load", on the popup choose file type "All Files" and choose your private key, usually called "id_rsa" (not id_rsa.pub - that's the public key)
It will load and tell you to click Save Private Key to save in putty's format (.ppk).
Do it and save the newly converted .ppk key, then run "pageant" (the thing that loads your ssh keys on sourcetree) - Tools > Launch SSH Agent, then double-click its icon in the Notification Area.
Load your converted key on Pageant by clicking Add Key and looking for "convertedKey.ppk".
Done. Now you should be able to push via SourceTree !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: After testing a bit I found that PuTTy loses your key every time, and you have to reload it. A better option would be to just change the SSH client from PuTTy to OpenSSH
(Tools > Options then change SSH Client in SSH Client Configuration section)
Now it works every time without problems.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bit of a late reply here... You're right that OpenSSH is better, in every single way: But you /can/ make PuTTy start up with a loaded key. Regrettably I can't recall exactly how (I've switched completely to Linux now & as a result I can no longer use SourceTree - at least until Atlassian port it to Linux (PLEASE?)); but there's a command line option you can use... I put a shortcut into my startup folder which was something like 'putty.exe -o keyfile.key' (like I say, it's been a couple of years, the exact magic I cannot remember).
Hope that helps someone, especially if you've no choice but to use PuTTy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I could not get passed this problem either (Windows 10 fresh install). HTTPS worked, but I needed SSH as well. The above solutions I could not get to work. What I ended up doing is opening up Putty, ssh into the server (remember to get username and port set right), trust the host by hitting "y". Then go back to Sourcetree and WIN! Maybe will help someone else too. Good luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Rachel for sovling our issues. You really made my day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right on Rachael! Perfect solution and easy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For everyone who is struggling with this error on BitBucket SERVER (on prem) or who has Custom Ports.
I wasted almost 2 days on this error, the important difference, at least for me, wasthat i constantly got an "access denied" error with the plink command.
I finally did it by coincidence, because i tried from another site this complete command with password included:
plink.exe -ssh -pw "YourPassword" username@YourOnPremBitBucketServerURL
The breakthrough was adding the port parameter -P. Our admin team choose 7999. I think most use 2222. You can find your port in BitBucket Admin / Server settings.
With the port it finally worked, here the complete command:
plink.exe -ssh -pw "YourPassword" username@YourOnPremBitBucketServerURL -P YourPort
Just for complete documentation, as many above wrote the plink.exe can be found in the install directory of SourceTree or Putty:
- SourceTree: C:\Users\USERNAME\AppData\Local\SourceTree\app-SOURCETREEVERSION\tools\putty
- Putty: C:\Program Files\PuTTY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After running the following command i received : FATAL ERROR: Network error: Connection timed out.
"C:\Users\username\AppData\Local\SourceTree\app-3.4.8\tools\putty\plink.exe" bitbucket.org
Do you have any idea?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try opening the terminal by going into Action --> Open In Terminal
Then within the terminal paste the git repo URL you will be prompted to accept the server finger print.
Type yes and enter. Server fingerprint will be cached.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is better to switch to open ssh. Much simpler to use. You can do that by going to Tools > Options > General then change SSH Client to OpenSSH.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should anyone still care:
Exact same error message (y/n cache stuff) deleting the local repo and recloning of those with such error msg helped me out......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Daniel Eads Since we can't report bugs anymore: https://community.atlassian.com/t5/Sourcetree-questions/how-do-i-report-a-bug-in-sourcetree/qaq-p/1164591
Is this issue in your bug tracker anywhere? I had this exact problem today with a new developer, fresh Windows 10 install, fresh SourceTree install.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the method that worked for me, taken from stack overflow:
The way to add bitbucket as a host to PuTTY's cache is to run the
following command:
plink.exe bitbucket.org
Just answer y, and then Ctrl+C, ignore the rest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm struggling with this as well. The command line plink caching technique has worked elsewhere but for whatever reason I have one machine on which this doesn't work. git bash finds credentials and repeated plink suggests that it finds the cached key as well. Only sourcetree believes the key is not cached. Using the embedded git does not change anything.
Using SourceTree 3.4.9
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For me worked what others have already pointed out.
Run the following command, replace <DestinationFQDN> with your actual server address.
%LOCALAPPDATA%\SourceTree\app-3.4.9\tools\putty\plink.exe <DestinationFQDN>
e.g.
%LOCALAPPDATA%\SourceTree\app-3.4.9\tools\putty\plink.exe gitlab.contoso.lan
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.