[Other doc versions]
[Doc downloads (PDF, HTML, XML)]
Note that Stash supports DSA and RSA2 key types – RSA1 is not supported.
Before you can use SSH keys to secure a connection with Stash the following must have already been done:
To get the SSH key to work with your build, or other, system, you need to:
You simply copy the public key, from the system for which you want to allow access, and paste it into Stash.
Copy the public key. One approach is to display the key on-screen using cat
, and copy it from there:
cat < ~/.ssh/id_rsa.pub
Now, in Stash, go to the Settings tab for the project or repository.
Click Access keys and then Add key.
git pull
or git clone
operations for example, where you want to be sure that the system will not be able to write back to the Stash repository.git push
or git merge
operations for example, where you may want your build system to merge successful feature branch builds to the default branch in the Stash repository, or so that deployments can be tagged. Paste the key into the text box and click Add key.
You can delete an access key by going to Settings > Access keys for the repository, and clicking the cross for the key (the cross only appears when you move the mouse pointer there):
If the key is used for multiple projects or repositories, you can select the other places that you want the key to be deleted from:
Note that the dialog only displays the projects and repositories that you have permission to see. Be aware that the key may also be used in other places that are not listed in the dialog. To be 100% sure that all uses of the key are deleted, this operation must be performed by someone with the administrator or sysadmin global permission.