Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Created May 1, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadLittleMods/275dbb32ce47c175fede7d368d425421 to your computer and use it in GitHub Desktop.
Save MadLittleMods/275dbb32ce47c175fede7d368d425421 to your computer and use it in GitHub Desktop.
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