Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Restart ssh-agent in Cmder

Sometimes the Cmder SSH agent seems to be borked and anything you try to connect to just rejects. I often run into this when running an Ansible command on a remote host

ssh root@xx.xxx.xxx.xxx
root@xx.xxx.xxx.xxx: Permission denied (publickey).
ssh_exchange_identification: Connection closed by remote host

Fix

Just kill the ssh-agent.exe processes (Task Manager works just fine),

Then restart the SSH agent,

$ start-ssh-agent
Removing old ssh-agent sockets
Starting ssh-agent:  done
@TrainDoctor
Copy link

This does not work with the latest versions of Cmder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment