cmder icon indicating copy to clipboard operation
cmder copied to clipboard

How to use ssh-agent

Open jackharding opened this issue 9 years ago • 8 comments

Hi there. I'm new to using the command line and I'm trying to use Cmder to SSH in to my VPS.

I uncommented this line in my user-profile.cmd call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"

When I started cmder back up I got the following message: Removing old ssh-agent sockets Starting ssh-agent: done

But still when I try to ssh in to my server, with pageant running, I get 'Permission denied (publickey).'

I've been trying to get this working on a couple different programs for a while now. There's so much to know and it's hard to know what to even search in Google.

Any help would be greatly appreciated!

jackharding avatar Jun 19 '17 20:06 jackharding

Have you run ssh-add?

MartiUK avatar Jun 20 '17 10:06 MartiUK

I didn't run that. I just did now but nothing seems to happen.

jackharding avatar Jun 20 '17 11:06 jackharding

Hi @jackharding,
the execution of %GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd is the prerequisite to run the agent. Then you need to add your personal key to the agent. Supposing you have your own key in C:\Users\Jack\Documents\Keys\jack-personal.key, you need to execute the command:

ssh-add C:\Users\Jack\Documents\Keys\jack-personal.key

Note: in this case, you are loading ssh-agent. If you prefer a unique agent in Windows, you might also consider using the PuTTY Agent. In that case the agent to be launched is:

call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"

acataluddi avatar Nov 26 '17 10:11 acataluddi

You might be interested in reading the wiki page I've just written for future references.

@MartiUK, maybe we can close this issue.

Thanks, Adriano

acataluddi avatar Nov 26 '17 11:11 acataluddi

Thanks @acataluddi.

MartiUK avatar Nov 29 '17 12:11 MartiUK

Hello, I`m using CMDER full and when try to do the same by uncomment call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" line and after start cmder, try to add my key but receive message:

Could not open a connection to your authentication agent.

wemersonrv avatar May 16 '18 20:05 wemersonrv

Hi @wemersonrv,

Please make sure that you followed the configuration steps described in the following document:

https://github.com/cmderdev/cmder/wiki/Integrate-SSH-Agent-or-PuTTY-Agent

Regards,
Adriano

acataluddi avatar May 16 '18 21:05 acataluddi

Tried the above but they didn't work, what did work is adding this to user_profile.sh:

eval $(ssh-agent -s) ssh-add

kraftman avatar Jan 02 '19 21:01 kraftman