7

我尝试按照此处的说明进行操作。

我不断收到以下消息:

ssh:与 git@github.com:22 的连接已退出 无法使用身份验证方法。致命:远端意外挂断。

我遵循的步骤

  1. 制造钥匙
  2. 将密钥复制到 github。
  3. Checked Key 通过运行正常工作

    ssh -i ~/.ssh/id_rsa git@github.com

  4. 在 ~/local/bin/ 中创建了文件 ssh-git

    执行 ssh -i ~/.ssh/id_rsa "$@"

  5. 使文件可执行:

    chmod 755 ~/local/bin/ssh-git

  6. 将以下行添加到 ~/.bashrc

    导出 GIT_SSH=~/local/bin/ssh-git

  7. 跑了这个

    git clone git@github.com/username/reponame.git

  8. 我收到以下错误:

    ssh:与 git@github.com:22 的连接已退出 无法使用身份验证方法。致命:远端意外挂断。

4

3 回答 3

6

As described here you can set up cloning via ssh (HTTPS is not supported) with: first, a passphrase-less key in ~/.ssh/id_pub:

mkdir ~/.ssh
dropbearkey -t rsa -f ~/.ssh/id_rsa
dropbearkey -y -f ~/.ssh/id_rsa | sed -n 2p > ~/.ssh/id_rsa.pub

Second, a wrapper script ~/local/bin/ssh-git and make it executable with chmod +x ~/local/bin/ssh-git:

#!/data/data/com.spartacusrex.spartacuside/files/system/bin/bash
exec ssh -i ~/.ssh/id_rsa "$@"

Third, some settings in .bashrc. I have put it in another file included by .bashrc on Android only, so I can use the same .bashrc on other environments too:

export GIT_SSH=~/local/bin/ssh-git
export GIT_AUTHOR_NAME="USER NAME"
export GIT_AUTHOR_EMAIL="user@email.address"
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL

Restart Terminal IDE before this changes can be used.

There is another thread on this is at https://code.google.com/p/terminal-ide/issues/detail?id=26.

于 2014-02-27T08:22:11.380 回答
1

尝试使用以下语法进行克隆:

git clone git@github.com:username/reponame

于 2013-10-30T17:35:47.560 回答
0

我相信终端 IDE 现在存在无法解析主机名的问题。这意味着您必须使用 IP 地址而不是 github.com,也可以尝试使用git clone https://IP/User/REPO.git

于 2013-10-26T16:41:14.473 回答