Jump to content

Recommended Posts

Posted

Есть ПК на линуксе (Ubuntu 20), хочу настроить работу с github.com.

Сгенерировал ключи (ed25519), добавил их в учетную запись на github.

В файл ~/.ssh/config добавил настройки хоста:

Host github.com:user/*
    Hostname github.com
    IdentityFile ~/.ssh/id_github.pub
    IdentitiesOnly yes
    KexAlgorithms curve25519-sha256
    ForwardAgent yes
    ServerAliveInterval 120
    TCPKeepAlive no

 

Делаю тест подключения - успешно:

$ ssh -T git@github.com
Hi! You've successfully authenticated, but GitHub does not provide shell access.

 

Подключаюсь к репозиторию - тоже успешно:

$ ssh git@github.com:user/repo.git
PTY allocation request failed on channel 0
Hi! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

 

А вот клонировать репозиторий не могу:

$ git clone git@github.com:user/repo.git
Cloning into 'repo'...
Unable to negotiate with 140.82.121.3 port 22: no matching key exchange method found. Their offer: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
fatal: Could not read from remote repository.

 

Не могу понять, почему.

 

Если в ~/.ssh/config сделать так:

Host *
    KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,curve25519-sha256
    Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr

то проблема решается, git clone выполняется успешно.

Но мне не очень нравится изменение настроек для всех хостов; git заработал, а что-то другое отвалится.

Posted

Так не надо менять для всех , сделайте измененя только для github.com
Host github.com

    KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,curve25519-sha256

    Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr

Posted
59 минут назад, orlik сказал:

сделайте измененя только для github.com

Делал, конечно. Это не помогало, помогло только Host *.

 

18 минут назад, orlik сказал:

зачем вам обязательно ed25519  ?

Рекомендация github.

С ключом, сгенерированным по умолчанию, подключиться не удалось, хотя публичный ключ загрузился успешно.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...