SmartGit won't authenticate with ssh
Asked Answered
F

6

18

I have a webserver with gitolite installed and where i login using my ssh key. Normally i just use git on the server itself using the command line but for a new project i need to clone a repo on my windows pc and i would like to use SmartGit for this.

But i've spend several hours already just to clone the repo via Smartgit. As remote Git i use the url i normally would use on the server: me@my-server:the-repo then after a while i get a dialogue box 'SSH Authentication' and i select my private key, as i would do for pagent, and put in my Passphrase. But when i click login it just tries to connect for a while and then shows me the 'SSH Authentication' dialogue box again. No error message or anything.

I tried the clone the repo with the same data via command line and that works just fine. So is there something i'm missing?

Frasco answered 9/1, 2012 at 13:2 Comment(0)
F
25

Needed to save my ssh private key as an OpenSSH key in PuTTYgen because SmartGit only understand that format.

Frasco answered 9/1, 2012 at 13:27 Comment(2)
That's weird, but if you click the PuTTYgen "Save private key" or "Save public key" it will not work. You need save via menu Conversions → Export OpenSSH Key. This file will accpetedEngaging
on Windows, you can also switch to internal SSH tool in SmartGit preferences - it asks for ssh key passwords and just worksTracheostomy
T
13

Yes, that's it!

I just want to go in details to help the ones starting from scratch:

on windows you can do the following procedure:

  1. Install msysgit from Here
  2. To generate public/private key pair as needed by many git servers (like Assembla) use PuTTYgen that you find here: click on Generate and move your mouse until it tells you that the key is generated. Optionally, enter a passphrase to protect your private key
  3. Save or copy the public key at your need
  4. Save private key to use with SmartGit using menu voice Conversions/Export OpenSSH key
  5. Use the last file to authenticate in SmartGit
Tutt answered 9/1, 2012 at 22:52 Comment(0)
F
6

If you want to use putty as ssh client, please follow the below steps:

  1. Edit|Preferences|Commands|Authentication, choose Use System SSH Client
  2. In windows system variables, set GIT_SSH=plink (where putty's plink.exe location)

After that, please use pageant and load the private key

Foreconscious answered 19/10, 2016 at 17:40 Comment(0)
A
5

If you're using SmartGit on MacOS X, this problem causes an unexpected dialog to be displayed in the Finder:

"SSH - Enter passphrase for key '/Users/username/.ssh/id_rsa':"

It pops up when SmartGit is launched, and it looks like this:

SmartGit SSH passphrase prompt

It's odd and confusing how it looks like a Finder dialog, with no reference at all to SmartGit. It's usually caused by the SSH key password not being stored in the Keychain Access app. That's where SmartGit will look for it. You'll need to add it in there, like this:

  • For MacOS 12 (Monterey), 13 (Ventura), 14 (Sonoma), 15 (Sequoia), and newer, use this in the Terminal:

ssh-add --apple-use-keychain ~/.ssh/id_rsa (assuming id_rsa is your private key file)

  • For MacOS 11 (Big Sur), 10.15 (Catalina), 10.14 (Mojave), 10.13 (High Sierra) and below, use this in the Terminal:

ssh-add -K ~/.ssh/id_rsa (assuming id_rsa is your private key file)

The above commands are usually needed after restarting your computer. See also these guides:

Avaricious answered 16/1, 2017 at 15:18 Comment(2)
I got this problem after every restart, does anybody know why it's happening and how to prevent it once and for all?Underneath
Nevermind, I found an answer here apple.stackexchange.com/a/264974Underneath
B
4

I found it easier to change SmartGit | Preference | Commands | Executables to use "C:\Program Files (x86)\Git\bin\git.exe", and then set GIT_SSH=plink in the system env.

Bourgeois answered 29/4, 2013 at 16:31 Comment(0)
Z
0
  1. generate a PEM private key

ssh-keygen -t rsa -b 4096 -m PEM

(add the public key to your git host)

  1. clone (or re-clone) your project form smargit UI,

(In my case, I had to remove my local project and then clone it from smargit, i wasn't able to make it work with an existing local project, smartgit always told me the private key (id_rsa) was wrong or the passphrase was wrong, It took me one day to succeed, i hate so much smartgit!!!)

Zoezoeller answered 14/12, 2020 at 11:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.