【问题标题】:ssh-agent not working with gitssh-agent 不能与 git 一起使用
【发布时间】:2018-07-03 19:22:51
【问题描述】:

在全新安装 Cygwin(之前使用 git-bash)时,我无法将 ssh-agentgit 一起使用。

ssh-agent 配置良好,ssh 命令有效。

$ 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.

但是当使用git 命令时,它似乎没有加载我的 ssh 密钥。

$ 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 运行良好。

使用另一个终端(例如:git-bash),它也可以工作。

我的 .ssh 文件夹:

$ 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

我错过了什么?

【问题讨论】:

    标签: git ssh ssh-agent


    【解决方案1】:

    好的,发现我的错误:我使用的是我的 windows 命令git(来自 git for windows)而不是 cygwin。

    卸载 Windows 并安装 cygwin 解决了我的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-02-24
      • 2011-04-09
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 2016-04-10
      • 2023-01-13
      相关资源
      最近更新 更多