Stash SSH : remote end hung up unexpectedly

Hi,

I have an evaluation version of Stash installed. The HTTPS git clone/pull/push is all working well. But when I configure it to enable SSH Access, I can't communicate with the repository over SSH.

i.e.:

$ git clone ssh://git@localhost:7999/wflow/workflow.git here
Cloning into 'here'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I don't understand the issue. Does the repo not exist from the above URL? Or is it a repo permissions problem? Why does HTTP work and SSH not?

3 answers

2 votes
Jeff Thomas Atlassian Team Feb 25, 2014

It seems like your public key has not been added to Stash or is not configured properly on your local machine. Check out the documentation at https://confluence.atlassian.com/display/STASH/Using+SSH+keys+to+secure+Git+operationsfor how to setup keys for Stash.

Thanks Jeff,

However, if I set the project to have "Public Access", I don't believe that I need to add keys to people (especially if it's just cloning), no?

Jeff Thomas Atlassian Team Feb 25, 2014

I believe you're correct, you shouldn't need to setup keys if they repository is public.

EDIT: Thanks to John for pointing out that SSH doesn't work for a public repository without keys.

Just to test, I added the SSH keys of the remote machines that would be cloning on the Stash server machine.

Everything works! So it's 100% an SSH access issu.

But I don't understand why I must add the SSH keys of the remote machines in order to clone. Cloning should be free and accessible for everyone to do, especially if I enable "Public Access."

I believe the "public access" is only for http. SSH is meant to increase the level of security and not allow anyone to anonymously do things.

Yes, I believe your'e right John. This was more of a misunderstanding of how Stash is configured to work.

Everything is good now. Thanks for all the support.

On a side note, I ran "netstat -lt" and noticed that I have a service running for the web interface at :7990 (makes sense), but I do not have a service running for :7999. Would this have anything to do with it?

I did open up the 7999 port via firewalls.

Jeff Thomas Atlassian Team Feb 25, 2014

Have you tried restarting Stash after turning on SSH?

Jeff Thomas Atlassian Team Feb 25, 2014

Could you turn on debug logging, restart Stash, and then attach your atlassian-stash.log file? I'll see if I can see anything in there that might narrow down the issue.

You can turn on debug loggin in the admin menu under Logging and Profiling.

The atlassian-stash.log file is located in <Stash installation>/log

I have, I ran stop-stash.sh followed by start-stash.sh. Hasn't fixed the issue :(

()

I ran "netstat -lt --numeric-port", which actually did list a service listening at 7999. Sorry about that, didn't realize the numeric-port flag was required () .

Suggest an answer

Log in or Join to answer
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...

696 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot