Howto use ssh protocol for a Stash host (remote) instead of https

Bildschirmfoto 2015-02-05 um 08.28.56.png

I tried to use the SSH protocol for our local Stash server. Trying to specify the Host URL - like ssh://git@stash.example.com:7999/ - I'll always get a message about a malformed URL. Using HTTPS instead is possible and works, but I don't want to use user credentials here.

How can I configure the access using the SSH protocol?

1 answer

This widget could not be displayed.

First you need to upload your SSH key into your account on the Stash server at http://<serverURL>/plugins/servlet/ssh/account/keys

Once you are done with this, I think you just need to just write http://<serverURL>/ into the dialog above.

I've already added my keys on the server side. I can use the "clone using SourceTree" link within the Stash Web UI, but I can't use ssh for the local SourceTree integration as shown above. Using http(s) as suggested works, but I want to use ssh instead to avoid the user credentials here.

You said your problem was that the URL was malformed. You need to specify it as http://<serverURL>/ (and select SSH at the bottom). Not sure if you can get away here without giving your user/pass once, but you will definitely not have to give them any more.

Selecting SSH doesn't change it as expected. Using clone for a remote configuration like this, always uses http(s) using the user credentials and the specified URL.

This is only for the "Hosted Repositories" feature. The individual clones use HTTP(S)/SSH depending on what clone URL is given in the origin URL in the repository settings. If you cloned a repo using HTTP(S), you need to change the origin URL in the repository settings.

I'm trying to do the same thing. https access to my local Stash server works fine, but when I try to browse the remote repos using ssh authentication, I am prompted for a password which doesn't make sense since ssh authentication doesn't need a password. If I enter something in the password field, ST now tells me that I have a malformed URL. I'm getting the impression that the ST devs didn't ever actually test this.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

872 views 2 3
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