To start off, I am on the 64-bit version of Windows 10.
After positing the follow code into my .bashrc file:
SSH_ENV=$HOME/.ssh/environment # start the ssh-agent function start_agent { echo "Initializing new SSH agent..." # spawn ssh-agent /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add } if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi
And then restarting Git Bash, I get a bash message stating:
bash: [-f/c/Users/<user>/.ssh/environment]: No such file or directory Initializing new SSH agent... succeeded bash: ./c/Users/Nick/.ssh/environment: No such file or directory Could not open a connection to your authentication agent.
When I check ~/.ssh I see I have the 'environment' in there. The file's contents are:
SSH_AUTH_SOCK=/tmp/ssh-YPNbq3XWRqJ8/agent.10808; export SSH_AUTH_SOCK; SSH_AGENT_PID=7904; export SSH_AGENT_PID; #echo Agent pid 7904;
I'm guessing the script is trying to find /dev/null or /usr/bin/ssh-add and failed. Neither of those are located in my $HOME directory. I'm guessing those paths are for setting up SSH for Git on linux as well. Should I be pointing to another directory? Thanks in advance.
Add this code to .bash_profile worked for me.
From http://stackoverflow.com/questions/18880024/start-ssh-agent-on-login
Time to up your Loom game! The new Loom Essentials Certification is here! Show off your skills, learn pro tips, and get officially recognized. Perfect for taking your video messaging to the next level.
Learn moreOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.