Не удается подключиться к github, но другие репозитории git, bitbucket и ssh работают нормально - PullRequest
0 голосов
/ 25 мая 2018

Когда я пытаюсь клонировать репозиторий github, я получаю

Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sh
a2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521) 

Если я пытаюсь git clone из личного репозитория или из моей учетной записи bitbucket, он работает нормально.

Я на Windows7 64. Я использую Pageant в качестве агента SSH.Я пробовал и TortoisePlink.exe, и plink.exe (этот https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) в переменной среды GIT_SSH.

У меня не было проблем с этой конфигурацией и этими ключами SSH, пока я не отформатировал ивосстановил мой компьютер.

Я попытался удалить и повторно добавить ключи в моей учетной записи github, и я пытался использовать rsa 1024, rsa 4096 и ключ ed25519.

Iя запускаю git windows bash. Я также пытался использовать пользовательский интерфейс phpstorm, с тем же результатом.

Если я пытаюсь с TortoisePlink.exe, это происходит (также я получаю всплывающее окно с приведенным вышеупомянутая ошибка):

$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
fatal: Could not read from remote repository.

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

Если я попытаюсь с plink.exe, это происходит:

$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa xx:xx:xx
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)

Я нажимаю y и ничего не происходит (я считаю, что с обработкой ввода происходит что-то странноемежду git и plink)

если я пытаюсь подключиться к github через ssh, я получаю следующее

$ ssh git@github.com
key_load_public: invalid format
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Enter passphrase for key '/foo/bar/.ssh/id_rsa':
PTY allocation request failed on channel 0
Hi brazorf! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Git-версия:

$ git --version
git version 2.16.2.windows.1

1 Ответ

0 голосов
/ 31 мая 2018

Понятия не имею, почему за этот вопрос проголосовали.

Вот как я исправил эту проблему:

  • скачайте последнюю версию plink.exe здесь https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  • отредактируйте переменную среды GIT_SSH и убедитесь, что она указывает на plink.exe
  • закройте любую оболочку, терминал, ide и т. д.

Подробнее здесь https://github.com/desktop/desktop/issues/4105

...