Allow agent forwarding using Cmder (ConEmu)

I use cmder , which runs ConEmu on Windows 8.1.

It has built-in Git functionality, so I can pull / push the Git repositories in the console (like the Linux console).

For authentication, I use the SSH private secret key with a password. If I do git pushWith ConEmu, it will ask me for the key password every time. I can enter "start-ssh-agent" and enter the password once, and it will automatically authenticate me in this ConEmu window, however, if I close or open another window, I need to run the command again.

How can I run an ssh agent that will authenticate my key in every ConEmu window?

+4
source share
1 answer

The next time the SSH key is disabled, it is added during Cmder startup, and the password is entered only once per session:

@echo off
ssh-agent | grep -v echo | sed -e "s/^/@set /" | sed -e "s/;.*$//" - > call.cmd
call call.cmd
del call.cmd
ssh-add "%HOME%\.ssh\id_rsa"
@echo on

Add the code in cmder/config/user-startup.cmdin the current version of Cmder or in cmder/vendor/init.batfor older versions.

+4
source

All Articles