7

I tried following the directions here.

And I keep getting the following message:

ssh: connection to git@github.com:22 exited No auth methods could be used. fatal: The remote end hung up unexpectedly.

Steps I followed

  1. Made Key
  2. Copied Key to github.
  3. Checked Key was working properly by running

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

  4. Created the file ssh-git in ~/local/bin/

    exec ssh -i ~/.ssh/id_rsa "$@"

  5. Make the file executable:

    chmod 755 ~/local/bin/ssh-git

  6. added the following line to ~/.bashrc

    export GIT_SSH=~/local/bin/ssh-git

  7. Ran this

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

  8. And I get the following error:

    ssh: connection to git@github.com:22 exited No auth methods could be used. fatal: The remote end hung up unexpectedly.

3 Answers3

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.

Jakob
  • 3,570
  • 3
  • 36
  • 49
  • I used this for an entirely different device, the Onion Omega2+ which uses a version of OpenWRT. Thanks! – Paul J Feb 18 '17 at 19:14
1

Try cloning with the following syntax instead:

git clone git@github.com:username/reponame

Billy Pilgrim
  • 343
  • 2
  • 12
0

I belive that terminal IDE has a problem right now where it cannot resolve host names. That means instead of github.com, you must use the IP adress also try using git clone https://IP/User/REPO.git

Markko
  • 93
  • 6