简体   繁体   中英

ssh-agent not working with git

On a fresh install of Cygwin (used git-bash before), I can't use ssh-agent with git .

ssh-agent is well configured, as ssh command works.

$ ssh git@bitbucket.org
PTY allocation request failed on channel 0
logged in as lenouveau.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
Connection to bitbucket.org closed.

But when using git command, it doesn't seem to load my ssh key.

$ git fetch
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

git-gui works well.

With another terminal (ex: git-bash), it works too.

My .ssh folder :

$ ls -al ~/.ssh
total 38
drwx------+ 1 LeNouveau Aucun      0  3 juil. 11:39 .
drwxrwx---+ 1 Système  Système    0  3 juil. 11:37 ..
-rw-------+ 1 LeNouveau Aucun    133  3 juil. 11:39 agent.env
-rwx------+ 1 LeNouveau Aucun   1766 16 avr.  09:33 id_rsa
-rwx------+ 1 LeNouveau Aucun    402 16 avr.  09:33 id_rsa.pub
-rwx------+ 1 LeNouveau Aucun   3013 26 juin  14:34 known_hosts

What did I miss ?

Ok, found my mistake : I was using my windows command git (from git for windows) instead of the cygwin one.

Uninstalling the Windows one and installing the cygwin one solved my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM