8

The thing is that I do not have root permissions on the remote server and can't use the default ssh key location due to the same problem, even if they are for the user I am currently using the destination is OFF LIMITS.

I have found out I can create an ssh in a custom folder now I can't seem to find a way to pass that to git. To make it clear I can't edit the config file nor can I use any root commands.

There might be something like git -i ssh/path but I can't seem to find any documentation on this issue, for all I know this might not be even possible.

If anyone has found a solution to this any guidance is greatly appreciated!

EDIT : SOLUTION

Git clone with custom SSH using GIT_SSH error

Community
  • 1
  • 1
Krotz
  • 615
  • 3
  • 9
  • 21

2 Answers2

8

From the Atlassian how-to doc, located here:

https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html

  1. Open a terminal window and enter the ps -e | grep [s]sh-agent command to see if the agent is running.

    $ ps -e | grep [s]sh-agent
    9060 ?? 0:00.28 /usr/bin/ssh-agent -l
    
  2. If the agent isn't running, start it manually with the following command:

    $ ssh-agent /bin/bash
    
  3. Load your new identity into the ssh-agent management program using the ssh-add command.

    $ ssh-add ~/.ssh/id_rsa
    
  4. Enter passphrase for /Users/emmap1/.ssh/id_rsa:

    $ Identity added: /Users/emmap1/.ssh/id_rsa (/Users/emmpa1/.ssh/id_rsa)
    
  5. Use the ssh-add command to list the keys that the agent is managing.

    $ ssh-add -l
    2048 7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 /Users/manthony/.ssh/id_rsa (RSA)
    

Hope this helps...

supaflysnooka
  • 81
  • 1
  • 3
4

Use the environment variable GIT_SSH to alter the ssh command that Git uses and specify the path to the private key file:

GIT_SSH='ssh -i /home/user/id_rsa'

T Percival
  • 8,526
  • 3
  • 43
  • 43
  • ok so i've tried this eventually but it appears that it does not find the files for some reason (i've checked to make sure they are there) `"/usr/bin/ssh -o StrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -i /home/robert/press.lo/wp-content/.repos/.ssh/id_rsa": No such file or directory fatal: unable to fork` – Krotz Sep 12 '13 at 11:11
  • The identity file (private key) is stored on your local machine, not the remote server. – T Percival Sep 12 '13 at 18:03
  • i'm using xampp on localhost so, i don;t get it :D – Krotz Sep 13 '13 at 06:58
  • 1
    GIT_SSH does not accept by default options set in but i managed to point it to a script file that does just that :D thank you! – Krotz Sep 13 '13 at 17:20