Have a hint to enter a passphrase for .ssh / id_rsa

I followed the tutorial here to configure ssh for github in cygwin on Window 7. However, every time I do git push origin master I keep in mind the following:

Enter passphrase for /cygdrive/c/Users/mynameis/.ssh/id_rsa:

This is so annoying because it means you need to configure ssh first. I don’t understand why this makes me ask for a password, because when I did the same with my Mac, everything just worked fine and smoothly.

I tried other solutions, such as: adding eval ssh-agent -s to my .bashrc . But the problem still remains. I suspect that the problem is with ssh-agent or ssh-add in cygwin in window 7 .. How can I get around this problem?

+5
source share
1 answer

Add the following to your ~/.bash_profile . When bash starts, it does two things: 1. launches ssh-agent (otherwise it may appear and die for each push / pull) and 2. tells the agent to remember your passphrase. On some Linux distributions, this happens automatically, unfortunately, this does not apply to Cygwin.

 ## only ask for my SSH key passphrase once! #use existing ssh-agent if possible if [ -f ${HOME}/.ssh-agent ]; then . ${HOME}/.ssh-agent > /dev/null fi if [ -z "$SSH_AGENT_PID" -o -z "`/usr/bin/ps -a|/usr/bin/egrep \"^[ ]+$SSH_AGENT_PID\"`" ]; then /usr/bin/ssh-agent > ${HOME}/.ssh-agent . ${HOME}/.ssh-agent > /dev/null fi ssh-add ~/.ssh/id_rsa 

See also:

+11
source

Source: https://habr.com/ru/post/1213434/


All Articles