Вопросы

Невозможно клонировать частное репо Gitlab с помощью ключей ssh. Ключ аутентификации не работает

У меня есть пара ключей по умолчанию в моем .ssh, и я добавил id_rsa.pub в https://gitlab.com/profile/keys, но по-прежнему не может получить доступ к gitlab с помощью этих ключей.

ssh -vT [email protected]

не могу войти:

$ ssh -vT [email protected]
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to gitlab.com [35.231.145.151] port 22.
debug1: Connection established.
debug1: identity file /Users/denysobukhov/.ssh/id_rsa type 0
debug1: identity file /Users/denysobukhov/.ssh/id_rsa-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_dsa type -1
debug1: identity file /Users/denysobukhov/.ssh/id_dsa-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ecdsa type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ed25519 type -1
debug1: identity file /Users/denysobukhov/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/denysobukhov/.ssh/id_xmss type -1
debug1: identity file /Users/denysobukhov/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version ROSSSH
debug1: no match: ROSSSH
debug1: Authenticating to gitlab.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:pZaBIOeFjqundQMWm8JAamGIUe63cxi7G4ZTpGM5C+Y
debug1: Host 'gitlab.com' is known and matches the RSA host key.
debug1: Found key in /Users/denysobukhov/.ssh/known_hosts:19
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: Will attempt key: /Users/denysobukhov/.ssh/id_rsa RSA SHA256:x3OEhLg/QPPUvr1f4IPo0+uHv8q73Da1TGjUnzD8FdQ
debug1: Will attempt key: /Users/denysobukhov/.ssh/id_dsa
debug1: Will attempt key: /Users/denysobukhov/.ssh/id_ecdsa
debug1: Will attempt key: /Users/denysobukhov/.ssh/id_ed25519
debug1: Will attempt key: /Users/denysobukhov/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/denysobukhov/.ssh/id_rsa RSA SHA256:x3OEhLg/QPPUvr1f4IPo0+uHv8q73Da1TGjUnzD8FdQ
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/denysobukhov/.ssh/id_dsa
debug1: Trying private key: /Users/denysobukhov/.ssh/id_ecdsa
debug1: Trying private key: /Users/denysobukhov/.ssh/id_ed25519
debug1: Trying private key: /Users/denysobukhov/.ssh/id_xmss
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentications that can continue: password
debug1: Next authentication method: password
Permission denied, please try again.
[email protected]'s password:

не могу клонировать

Читать:
Pycharm, программа для прыжков с мячом в pygame

git clone [email protected]: denysobukhov / myprj

$ git clone [email protected]:denysobukhov/myprj
Cloning into 'myprj'...
[email protected]'s password:

моя конфигурация

cat / etc / ssh / ssh_config

$ cat /etc/ssh/ssh_config
Host *
    SendEnv LANG LC_*

добавление в пустой ~ / .ssh / config не помогло:

Host gitlab.com
    Hostname gitlab.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa

Почему у меня не работает ключ?

Согласно трассировке отладки, ваш клиент предложил серверу .ssh / id_rsa, но сервер его не принял. Это может быть вызвано несколькими причинами. Например, возможно, что ваш файл id_rsa.pub не соответствует файлу id_rsa, поэтому вы настроили github с неправильным открытым ключом.   —  person Denis    schedule 16.11.2019

Можете ли вы выполнить eval $(ssh-agent -s), а затем ssh-add ~/.ssh/id_rsa и попробовать еще раз? Я помню, что раньше делал это за меня. Если это не сработает, попробуйте удалить свой ключ rsa — если вы не используете его для чего-либо еще — и начните с нуля, следуя эти инструкции.   —  person Denis    schedule 16.11.2019

Я использую этот ключ для других сервисов и не могу его удалить. Я создал собственный ключ: gitlab_id_rsa. Добавил: ssh-add ~ / .ssh / gitlab_id_rsa $ ssh-add -l 4096 SHA256:BU0W1JRLgxvBPyXSYZ7qphRelLAECdDyvlAJndR1+4k [email protected] (RSA) 2048 SHA256:x3OEhLg/QPPUvr1f4IPo0+uHv8q73Da1TGjUnzD8FdQ [email protected] (RSA) Обновлено ~ / .ssh / config. IdentityFile ~/.ssh/gitlab_id_rsa Это не помогло. У меня такая же проблема на втором компьютере.   —  person Denis    schedule 16.11.2019

Похожие записи

Как определить неудачные приведения с помощью оператора dynamic_cast?

admin

Azure DevOps Pipeline изменяет разрешения сертификата для приложения Service Fabric

admin

как заархивировать содержимое папки с помощью аргумента командной строки?

admin

Не удается найти пакет gitlab-ci-multi-runner

admin

Flutter / Dart получает изображение / данные из API на основе токена входа пользователя

admin

Явное расщепление массива на указатель

admin