Is it possible to provide anonymous access to a Stash hosted git repository?

T. Alexander Lystad October 30, 2012

Hi,

I would like to know if it is possible to provide anonymous access to a Stash hosted git repository? By anonymous access I mean connecting to the git repository without specifying a username and/or password.

3 answers

2 votes
FernandoA
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.
November 5, 2012

Hi Alexander,

This is currently not possible at the moment.

We are tracking this feature to be implemented here: https://jira.atlassian.com/browse/STASH-2565

I'd strongly suggest you to vote and comment on this case to raise its awareness and also add yourself as a watcher for following further updates.

Cheers!

1 vote
mwatson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2012

There is currently no way to do this, but there are workarounds involving using SSH.

In our CI setup, we have a passphraseless ssh keypair set up for the CI user on all the CI server/agents (we copy the same keypair to each agent, but if you want to you could create a separate one for each) .

We have created a user who has read-only permissions to the repositories we need CI to access and add the public key to the user in Stash.

Once this is set up, the CI server can use the ssh url to clone from and we do not need to specify a username and password. Ssh will automatically use the keypair in the CI users ~/.ssh directory to authenticate with stash.

The only gotcha is that if it is the first time the CI user has checked code out from stash, it will prompt the user to accept a previously unknown host certificate - the workaround for that is to manuall try and clone as the CI user first (on each agent, or copying over the ~/.ssh/known_hosts file to each agent) or to disable checking (a potential security issue (see http://askubuntu.com/questions/123072/ssh-automatically-accept-keys).

We advise consulting with your IT security staff to help and audit this approach for your site.

0 votes
mwatson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2013

Suggest an answer

Log in or Sign up to answer