GIT over SSH in Ansible hangs, eventhough ssh-agent forwarding is set up

Just to expand on tillda’s answer, that config can be placed in an ansible.cfg file alongside your playbook. e.g.: ansible.cfg [defaults] transport = ssh [ssh_connection] ssh_args = -o ForwardAgent=yes I’d say it’s better to do that than setting as an env variable, as placing it in a conf file is both more declarative and also … Read more

Git- How to kill ssh-agent properly on Linux [closed]

You can kill ssh-agent by running: ssh-agent -k !NB, -k argument works only if $SSH_AGENT_PID environment variable is set. eval “$(ssh-agent -s)” sets the variable, but there’re also other methods to start the agent without setting the environment variable. E.g., connecting to a remote server implicitly starts the agent without setting the variable. In this … Read more

Using git with ssh-agent on Windows

posh-git and git for windows 2.7 should include everything you need to setup an ssh-agent. Once you have the module installed you can start the agent using something like: Import-Module ~\Documents\WindowsPowerShell\Modules\posh-git\posh-git Set-Alias ssh-agent “$env:ProgramFiles\git\usr\bin\ssh-agent.exe” Set-Alias ssh-add “$env:ProgramFiles\git\usr\bin\ssh-add.exe” Start-SshAgent -Quiet You then should see the SSH_AUTH_SOCK environmental variable is set: C:\Code\Go\src\bosun.org\cmd\scollector [master]> gci env:SSH_AUTH_SOCK Name Value … Read more