Get Cmder to use installed Git-for-Windows ssh keys.


  • | 2181 points

    Hi, I have Git-for-Windows installed on my machine (fully working) but I'd prefer to use Laragon's (4.0.2) Cmder as my CLI. Using the installed Git Bash I can push/pull/commit to bitbucket using my ssh keys but I can't using Cmder.

    So what changes do I need to make to my Cmder settings so that I can use the Git credentials? It would be great if you could do a short tutorial on how to set this up. Do I need to generate new keys?

    I have added this to my c:/laragon/usr/user.cmd file (I cannot use the %GIT_INSTALL_ROOT% variable as it doesn't handle the space in PROGRAM FILES).

    call "C:\Program Files\Git\cmd\start-ssh-agent.cmd"
    ssh-add

    Here's some CLI output.

    Opening Git Bash that came with Git for Windows:

    $ which ssh
    /usr/bin/ssh
    
    $ ssh-agent -s
    SSH_AUTH_SOCK=/tmp/ssh-1rK5sJHaIglZ/agent.4032; export SSH_AUTH_SOCK;
    SSH_AGENT_PID=3532; export SSH_AGENT_PID;
    echo Agent pid 3532;
    
    $ ssh -vT git@bitbucket.com
    OpenSSH_7.9p1, OpenSSL 1.0.2p  14 Aug 2018 ..
    
    

    Opening Cmder inside Laragon:

    Found ssh-agent at 8884
    Found ssh-agent socket at /tmp/ssh-HkW80jtYKSEo/agent.6848
    
    Error connecting to agent: No such file or directory
    
    C:\laragon\www
    λ which ssh
    /c/Windows/System32/OpenSSH/ssh
    
    C:\laragon\www
    λ ssh-agent -s
    unable to start ssh-agent service, error :1058
    
    λ ssh -vT git@bitbucket.com *note, this actually worked with errors
    OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 .. (along with various errors below)
    debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
    debug1: read_passphrase: can't open /dev/tty: No such file or directory
    

  • administrators
    | 97960 points

    @John-King :

    λ which ssh
    /c/Windows/System32/OpenSSH/ssh
    

    I think there is a conflict between ssh packages.


  • | 2181 points

    Thanks. Do you know if there's a way to get Cmder to use the other ssh package?


  • administrators
    | 97960 points

    @John-King :

    which ssh
    C:\laragon\bin\git\usr\bin\ssh.EXE
    

    You may need to remove your self-installed OpenSSH from Path.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.