[Other doc versions]
[Doc downloads]
Stash provides a simple way for user accounts and other systems to connect to repositories for Git operations, using SSH keys.
On this page:
You can use SSH keys to establish a secure connection between your computer and Stash for when you are performing read-write Git operations from your local machine. Personal keys are attached to your Stash account – they are bound by that account's permissions and use the account's identity for any operations.
Stash supports DSA and RSA2 key types – RSA1 is not supported. A Stash user can add any number of keys to their account.
Before you can use SSH keys to secure a connection with Stash the following must have already been done:
Once you have an SSH key associated with your Stash account, using it is easy! See Use SSH keys to connect to Stash repositories below.
On Windows, in your command prompt, change directory to your .ssh directory, and copy the public key file to your clipboard by running:
cd %userprofile%/.ssh clip < id_rsa.pub
On Mac OS X or Linux simply run the following in a terminal:
pbcopy < ~/.ssh/id_rsa.pub
sudo apt-get install xclip xclip -sel clip < ~/.ssh/id_rsa.pub
Note that on Linux, you may need to download and install xclip, as shown in the code snippet above.
In Stash, go to your account:
SSH access needs to have been set up, as described above. Once this is done, you can use SSH keys as follows:
Stash administrators can set up SSH access keys to allow other systems to perform read-only Git operations on repositories managed in Stash. This allows systems, such as your build and deploy server, to authenticate with Stash to checkout and test source code, without having to store user credentials on another system, and without requiring it to link to a specific user account.
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 that you want to have 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.
Paste the key into the text box and click Add key.