`ssh-add` se reinicia cada vez en Cygwin

Estoy usando cygwin terminal en Windows 10. Pero estoy enfrentando un problema de git via ssh . Aunque la terminal de Git Bash funciona siempre, cygwin necesita ssh-add todo el time. ¿Qué está pasando en mi cygwin?

 $ which git /cygdrive/c/Program Files/Git/cmd/git $ ssh-add -l Could not open a connection to your authentication agent. $ eval `ssh-agent` Agent pid 13900 $ ssh-add -l The agent has no identities. $ ssh -vT git@github.com OpenSSH_7.5p1, OpenSSL 1.0.2k 26 Jan 2017 debug1: Connecting to github.com [192.30.253.112] port 22. debug1: Connection established. debug1: identity file /cygdrive/c/Users/jef/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /cygdrive/c/Users/jef/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.5 debug1: Remote protocol version 2.0, remote software version libssh_0.7.0 debug1: no match: libssh_0.7.0 debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ssh-rsa debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /cygdrive/c/Users/jef/.ssh/known_hosts:1 debug1: rekey after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 134217728 blocks debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /cygdrive/c/Users/jef/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 Enter passphrase for key '/cygdrive/c/Users/jef/.ssh/id_rsa': debug1: Authentication succeeded (publickey). Authenticated to github.com ([192.30.253.112]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: pledge: network debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 Hi jojef! You've successfully authenticated, but GitHub does not provide shell access. debug1: channel 0: free: client-session, nchannels 1 Transfernetworking: sent 2664, received 1848 bytes, in 0.1 seconds Bytes per second: sent 35785.4, received 24824.1 debug1: Exit status 1 $ ssh-add ~/.ssh/id_rsa Enter passphrase for /cygdrive/c/Users/jef/.ssh/id_rsa: Identity added: /cygdrive/c/Users/jef/.ssh/id_rsa (/cygdrive/c/Users/jef/.ssh/id_rsa) $ git pull Already up-to-date. Restart cygwin terminal $ git pull git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

Encontré que el símbolo del sistema de Windows funciona correctamente.

 C:\Users\jef\work\movie_dialog>git pull Enter passphrase for key '/c/Users/jef/.ssh/id_rsa': Already up-to-date. C:\Users\jef\work\movie_dialog>where git C:\Program Files\Git\cmd\git.exe 

Actualizar

Remití el enlace de VonC, luego creé ~/.bash_profile , no bashrc . No estoy seguro .bashrc no funcionó. Entonces, puedo tirar! La frase de contraseña solo necesita una vez por cada inicio de session en Windows. Lanzamiento automático de ssh-agent en Git para Windows

Si ha configurado su .bash_profile en Cygwin , pedirá su frase de contraseña en cada nueva session de Cygwin, y su extracción de git tendrá éxito.

En Windows, al parecer, está ingresando su frase de contraseña cada vez, pero puede evitarla con un ~/.bashrc similar de Windows git bash .

Como mencioné antes , es probable que git sea diferente entre Cygwin y Git para Windows .


creado ~/.bash_profile , no bashrc . No estoy seguro .bashrc no funcionó. Entonces, puedo tirar!

Como se menciona aquí : .bashrc solo se lee con un intérprete interactivo y sin inicio de session. Pero abrir una session de cygwin puede considerarse como un "inicio de session", lo que significa que solo se lee .bash_profile .
Es por eso que la mayoría de la gente termina diciéndole a .bash_profile que también lea .bashrc con algo como:

 [[ -r ~/.bashrc ]] && . ~/.bashrc