Search code examples
linuxgitsshubuntu-16.04smartgit

Configure ssh private key in smartgit


I'm trying to configure a git repo in SmartGit through a SSH tunnel on Ubuntu 16.04.

I can't configure my private SSH key in SmartGit. I want to use the SmartGit SSH client but the Pereferences->Authentication don't allow me to add a key to use.

When I pull from the remote, I get a 'permission denied' error.

I found windows related topics but nothing on Linux distribs and nothing in SG documentation.


Solution

  • First, make sure to configure the System SSH client in the SmartGit preferences.
    If you have ssh in your path, you can then export the GIT_SSH_COMMAND environment variable to instruct Git to use the ssh :command of your choice.
    In your case, a command which would directly reference your private key

    export GIT_SSH_COMMAND='ssh -i /path/to/private/key'
    

    Then launch again SmartGit (for it to inherit that new environment variable), and try again your SSH tunnel.