IvanTorres
IvanTorres

Reputation: 63

Atlassian Stash doesn't work with ssh

I'm new in Atlassian Stash, I configured a new Atlassian Stash instance. I can clone by HTTP without problems, that now I want to clone the repository by SSH for security.

I have a problem when I clone it, the server asks me SSH keys when I configured the server without keys:

Source Path: ssh://user@ip:port/project/repository.git

The Repository type is in the state "Checking source..." and a Dialog appears:

"Authentication via SSH keys failed, do you want to launch the SSH key agent (Pageant) and retry? (If you don't have an SSH key yet....)

The SSH keys are not active! and I tried to add a private key to the Pageant Key List and doesn't work.

Upvotes: 0

Views: 3057

Answers (3)

justnpT
justnpT

Reputation: 1057

I had this problem, spent around 1-2 hours debugging it and here is my solution for the following assumptions:

  • assumption1: you have a gitlub account with 2 step authentication
  • assumption2: you have added sourcetree account authenticated with oAuth and via SSH
  • assumption3: you will need to add new SSH key pair in github settings
  • assumption4: after having the problem, pageant is running in your windows tray, in other words you can see it in the bottom right icons dialog

Steps to solve:

  1. sourcetree - tools - create or import SSH keys
  2. Putty dialog shows up
  3. choose key-SHH1 (RSA)
  4. choose Parameters -type of key to generate - RSA
  5. notice the empty box "No key." click genreate
  6. copy the key that appeared in the box
  7. go to gitlab - settings (top right), SSH and GPG keys - add SSH key, paste what you copied from the box, click add
  8. go back to the putty generator
  9. enter passphrase
  10. click 'save private key' choose location and filename and save
  11. right click on the pageant icon, that is running in your windows tray
  12. click 'add key', choose the file saved in step 9
  13. Problem solved

Upvotes: 1

Spiker
Spiker

Reputation: 111

For me the following configuration worked. Environment: OS: Windows 8 Git Repo: Stash Solution: Tools->Options->General->SSH Client Conf -> SSH Client -> Open SSH (from putty/plink)

Upvotes: 0

AlBlue
AlBlue

Reputation: 24040

In order to clone with SSH you need to have added your public key (not the private one!) to the remote Git server, and you need to ensure that your .ssh/ directory and files are not world/group-readable or writable. Try running ssh alone to the host/port and get that working first before trying to do anything with git.

Upvotes: 1

Related Questions