i have my own git server but i cant get ssh keys to work

Hi,

 

I hope someone can help me. I want to use Source tree as my git clients. I installed git server on a virtual linux debian server. It seems to be running except i cant seem to get the ssh keys to work.

 

here is some of my setup. I'm not sure what other information might be needed to help with my question but ill provide anything needed if you let me know

 

on linux i created a user called orbusgit. The server is on our internal network at 192.168.254.54. The git repository is at /home/orbusgit/repository/inhouseasp/live.git

Here is what i am trying to use in source tree

2016-03-25_8-06-50.jpg

I used puttygen to generate a private key and i put that file in my documents folder. In source tree > tools > options> General > SSH Client Configuration > SSH Key is pointing to this file.

SSH Client Putty/Plink

2016-03-25_8-27-44.jpg

The linux server side is the part i'm not sure i'm doing right.

On the putty Gen i clicked the save public key and i ftp'ed this file to the linux git server.

I then put the contents of the public key file into /home/orbusgit/.ssh/authorized_keys

 

cat /tmp/publickey.pub >> /home/orbusgit/.ssh/authorized_keys

This is the part i probably got wrong but i am not sure how to do it correctly.

 

 

When i try to connect with Atlassian it looks like this.

2016-03-25_9-37-39.jpg

 

any help would be appreciated

 

Paul

2 answers

1 votes

You have a typo in "Source Path" field, should be ssh:// instead of ssh:/

i thought that might be the problem also. the example i had found in google showed one "/". i've tried 2.

 

it just keeps spinning on "checking source...."

I think it times out at some point

It should definitely by ssh://

It might be a situation where the underlying SSH software needs some sort of interactive confirmation before connecting. What happens if you connect to the server with PuTTY or SourceTree's Terminal (ssh orbusgit@192.168.254.54)?

well.. my understanding of ssh and the keys is that its supposed to be a secure way to communicate that eliminates the need for user input/passwords. I would think that asking for a confirmation would defeat the purpose.

ok... i might be getting somewher on this... ok.. in putty i go to the connection category. SSH > Auth. In the authentication parameters i brows to my private key (the same one i point source tree at in tools > options> General > SSH Client Configuration > SSH Key

Then i go back to session and in the host name i type "ssh://orbusgit@192.168.254.54"

I get the following

2016-03-25_12-23-29.jpg

This tells me that it is hitting the server but the key on the server isn't the one i want it to point to.

ok.. so now my question is, how do i figure out where the key is that the server is pointing at?

That has nothing to do with your key. This is the standard procedure when connecting to a new server. Your key will allow the server to confirm your identity, but the SSH client has no way to confirm the server's identity.

So, the first time you connect, it asks you to take responsibility for this confirmation. If you say "Yes", PuTTY will cache that rsa2 key fingerprint, and will use that to confirm the identity of the server for all future connections.

TL;DR - If you are confident that there isn't a 3rd party executing a man-in-the-middle attack between you and the server, hit "yes", then everything will work.

You can also document that fingerprint somewhere, and other users connecting to the same server for the first time can compare the fingerprints so they can be 100% confident that "yes" is secure.

i think i understand. I am on a secure network and i'm sure there is no man in the middle attack.

the thing is, i just used putty for a test. I want to use source tree at the end of the day

You only need to use PuTTY once (per client computer) to accept the fingerprint. I've never lost an entry from PuTTY's registry cache short of reformatting my computer, or manually removing an entry.

Seth, let me see if i understand what you are saying.

You are saying i just need to login with putty the first time and go through the prompts that pop up, from then on i can login with sourcetree with the same ssh private key i used in putty?

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

262 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot