After Stash upgrade can't use ssh key to access Stash from SourceTree

Using SourceTree v1.3.3.0

Using Stash v2.10.0

After our Stash system was upgraded to v2.10, I can no longer access my git repos via SourceTree using a ssh key. The error I get when trying to fetch (or pull) is:

----

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

----

The strange thing is that I have the same stash repos checked out on a linux system and from both sandboxes, using the git CLI, I can access the git repo just fine (using the same ssh key).

4 answers

Note 1: I tried removing and re-adding my ssh key in stash but still not working in SourceTree

Check that the URL (ssh) path to the server is correct (under administration, server settings).

Was stash restarted as the correct user?

Thanks. I haven't heard of other having the same problem after the restart so I believe that Stash was restarted as the same user.

Hi Lars,

I'm not convinced that Stash is the cause here. That error looks like it's related to Putty and issues around the key either being in the wrong format. Have you double-checked the keys on that machine? What happens if you use the command line from the same Windows box?

Cheers,

Charles

Yeah, I've double checked the keys - that same key works fine with putty ssh-ing into the same server (I know, I know - this is accessing an ssh server not stash and not the same public key) but the public keys are the same and putty pageant key agent holds the same private key which is used both by SourceTree and Putty.

How would I run the command from command line?

Hi Lars,

If you open up Git Bash, which I believe should be installed on your machine, and run the following:

> git fetch

What error does that give?

Cheers,

Charles

I cloned the repository into a new folder and it started working

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,857 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you