Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash SSH : remote end hung up unexpectedly

Jan Markowski February 25, 2014

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
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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.

Jan Markowski February 25, 2014

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
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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.

Jan Markowski February 25, 2014

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."

jcurleyWR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2014

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.

Jan Markowski February 25, 2014

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.

0 votes
Jan Markowski February 25, 2014

()

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 () .

0 votes
Jan Markowski February 25, 2014

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
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2014

Have you tried restarting Stash after turning on SSH?

Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 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

Jan Markowski February 25, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events