SSH Agent Forwarding with Ansible

The problem is resolved by removing this line from the playbook: sudo: yes When sudo is run on the remote host, the environment variables set by ssh during login are no longer available. In particular, SSH_AUTH_SOCK, which “identifies the path of a UNIX-domain socket used to communicate with the agent” is no longer visible so … 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

How to permanently add a private key with ssh-add on Ubuntu? [closed]

A solution would be to force the key files to be kept permanently, by adding them in your ~/.ssh/config file: IdentityFile ~/.ssh/gitHubKey IdentityFile ~/.ssh/id_rsa_buhlServer If you do not have a ‘config’ file in the ~/.ssh directory, then you should create one. It does not need root rights, so simply: nano ~/.ssh/config …and enter the lines … Read more

Start ssh-agent on login [closed]

Please go through this article. You may find this very useful: https://web.archive.org/web/20210506080335/https://mah.everybody.org/docs/ssh Just in case the above link vanishes some day, I am capturing the main piece of the solution below: This solution from Joseph M. Reagle by way of Daniel Starin: Add this following to your .bash_profile SSH_ENV=”$HOME/.ssh/agent-environment” function start_agent { echo “Initialising new … Read more