How to use ssh-agent
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!
Have you run ssh-add?
I didn't run that. I just did now but nothing seems to happen.
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"
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
Thanks @acataluddi.
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.
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
Tried the above but they didn't work, what did work is adding this to user_profile.sh:
eval $(ssh-agent -s) ssh-add