Gitlab, Permission denied (publickey), стабильная версия 6-4

В разрешении отказано (публичный ключ). фатальный: не удалось прочитать из удаленного репозитория.

Убедитесь, что у вас есть правильные права доступа и репозиторий существует.

Gitlab версии 6-4 стабильный

[email protected]:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:     Ubuntu 12.04
Current User:   git
Using RVM:  no
Ruby Version:   2.0.0p353
Gem Version:    2.0.14
Bundler Version:1.5.2
Rake Version:   10.1.0

GitLab information
Version:    6.4.3
Revision:   38397db
Directory:  /home/git/gitlab
DB Adapter: mysql2
URL:        https://gitlab.xxx.xxx
HTTP Clone URL: https://gitlab.xxx.xxx/some-project.git
SSH Clone URL:  [email protected]/some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    1.8.0
Repositories:   /home/git/repositories/
Hooks:      /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git



[email protected]:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.9 ? ... OK (1.8.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... 
Alexander  / Test ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.2.12
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... 
Alexander  / Test ... yes
Projects have satellites? ... 
Alexander  / Test ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.5)

Checking GitLab ... Finished

И пытаясь подтолкнуть

См. также:  vscode: как узнать позицию курсора в документе?

root @ gitlab: / home / git / repositories / test # git push origin master

В разрешении отказано (открытый ключ). фатальный: не удалось прочитать из удаленного репозитория. Убедитесь, что у вас есть правильные права доступа и репозиторий существует.

shh -vv [email protected]

 [email protected]:~$ ssh -vv [email protected]
OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to gitlab.xxx.xxx [192.168.0.40] port 22.
debug1: Connection established.
debug1: identity file /home/alex/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2047
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2047
debug1: identity file /home/alex/.ssh/id_rsa-cert type -1
debug1: identity file /home/alex/.ssh/id_dsa type -1
debug1: identity file /home/alex/.ssh/id_dsa-cert type -1
debug1: identity file /home/alex/.ssh/id_ecdsa type -1
debug1: identity file /home/alex/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH_5*
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: Host 'gitlab.xxx.xxx' is known and matches the ECDSA host key.
debug1: Found key in /home/alex/.ssh/known_hosts:30
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/alex/.ssh/id_rsa (0x7f8d86afa4f0),
debug2: key: /home/alex/.ssh/id_dsa ((nil)),
debug2: key: /home/alex/.ssh/id_ecdsa ((nil)),
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/alex/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 276
debug2: input_userauth_pk_ok: fp xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: Authentication succeeded (publickey).
Authenticated to gitlab.xxx.xxx ([192.168.0.40]:22).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LC_PAPER = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_ADDRESS = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MONETARY = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_NUMERIC = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_TELEPHONE = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_IDENTIFICATION = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MEASUREMENT = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_TIME = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_NAME = de_DE.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 100 id 0
PTY allocation request failed on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Welcome to GitLab, Anonymous!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Connection to gitlab.xxx.xxx closed.
Transferred: sent 4088, received 2432 bytes, in 0.3 seconds
Bytes per second: sent 14872.5, received 8847.8
debug1: Exit status 0

alex @ xxxxx: ~ $ ssh [email protected] Ошибка запроса распределения PTY на канале 0 Добро пожаловать в GitLab, анонимный! Подключение к gitlab.xxx.xx закрыто.

См. также:  Как передать значение параметра из конвейера Gitlab CI / CD через Terraform в сценарий user_data в AWS?

Я пробовал использовать стабильную версию 5.4 и ту же проблему на рабочем сервере.

Но когда ради интереса я установил 5.4 на локальный тестовый сервер с виртуальным ящиком, и он отлично работает. Теперь я даже сравнил все, но он не нажимает на производственный сервер. Похоже, эта проблема связана с SSH.

Я уже много искал, но все решения, которые я пробовал, в моем случае не работали. Я уже понятия не имею, похоже, что это какая-то программная ошибка …

Буду признателен за любую помощь. Заранее спасибо! С уважением, Алексей

Возможный дубликат Отказано в разрешении (открытый ключ) на gitlab   —  person Alexander    schedule 04.03.2017

Понравилась статья? Поделиться с друзьями:
IT Шеф
Комментарии: 7
  1. Alexander

    Привет, у меня была аналогичная проблема (это было после добавления нового ключа ssh для вновь созданного пользователя). Я исправил его, восстанавливая authorized_keys, который был поврежден

    cd / home / git / gitlab

    sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
    This will rebuild an authorized_keys file.
    You will lose any data stored in authorized_keys file.
    Do you want to continue (yes/no)? yes
    

    Спасибо за повтор! У меня, к сожалению, не работает. Все так же с ошибкой запроса выделения PTY на канале 0 person Alexander; 20.01.2014

    Тогда я бы посоветовал зарегистрировать проблему в github, они обычно быстро обнаруживаются: github.com/gitlabhq/gitlabhq/ person Alexander; 21.01.2014

    Хитвен, большое спасибо! Моя проблема теперь также находится на GitHub github.com/gitlabhq/gitlabhq/issues/6104 person Alexander; 21.01.2014

    такая же проблема, используя виртуальную машину linux под ключ. Этот ответ сработал для меня. в моем случае не нужно прикасаться к /home/git/repositories/.ssh/authorized_keys вручную person Alexander; 30.03.2015

  2. Alexander

    Я отправил ответ на аналогичный вопрос

    https://stackoverflow.com/questions/17726281/unable-to-make-a-ssh-connection-to-gitlab-but-http-push-and-clone-are-working/22747572#22747572

    который включает добавление вашего открытого ключа в

    /home/git/repositories/.ssh/authorized_keys
    
  3. Alexander

    Добавление папки .ssh в репозитории сработало для меня, поэтому я сделал это:

    sudo -u git -H ln -s /home/git/.ssh /home/git/repositories/
    

    Теперь все пользователи могут добавить ключ из gitlab web и использовать ssh.

  4. Alexander

    Попробуйте также нажать на URL https вместо ssh, это может сэкономить вам много проблем — например, используйте это:

    git remote add origin https://gitlab.com/someuser/algorithm-excercises.git

    вместо того:

    git remote add origin [email;protected]:someuser/algorithm-excercises.git

  5. Alexander

    Я нашел это после многих поисков. Для меня это сработает отлично.

    1. Перейдите в «Git Bash» точно так же, как cmd.
    2. Тип 1_
    3. Нажмите Ввод.
    4. Он попросит вас сохранить ключ в определенном каталоге.
    5. Нажмите Ввод. Вам будет предложено ввести пароль или войти без пароля.
    6. Открытый ключ будет создан для конкретного каталога.
    7. Теперь перейдите в каталог и откройте папку .ssh.
    8. Вы увидите файл id_rsa.pub. Откройте его в блокноте. Скопируйте из него весь текст.
    9. Перейдите на страницу https://gitlab.com/profile/keys.
    10. Вставьте сюда в текстовое поле «ключ».
    11. Теперь нажмите на «Заголовок» ниже. Он будет заполнен автоматически.
    12. Затем нажмите «Добавить ключ».

    Теперь попробуйте, и он наверняка сработает.

    Пожалуйста, не добавляйте один и тот же ответ на несколько вопросов. Ответьте на лучший, а остальные отметьте как дубликаты. См. Допустимо ли добавлять дублирующийся ответ на несколько вопросов? person Alexander; 04.03.2017

  6. Alexander

    откройте свой терминал и сделайте открытый ключ:

    ssh-keygen -t rsa -C "[email;protected]" -b 4096

    перейдите в папку ssh rsa в вашей системе: на Mac перейдите в GO to Folder и введите этот адрес:

    ~/.ssh
    

    затем откройте его в текстовом редакторе и скопируйте ключ

    затем перейдите в gitlab, установив ключ shh и запатентовав его там https://gitlab.com/profile/keys/2346923

    затем попробуйте еще раз

    git push -u origin master
    
  7. Alexander

    Убедитесь, что у вас есть существующая локальная пара ключей SSH.

    Перейдите в свой домашний каталог, затем перейдите в подкаталог .ssh/. Если подкаталог .ssh/ не существует, значит, вы либо не находитесь в домашнем каталоге, либо раньше не использовали ssh.

    Если не существует, вам необходимо сгенерировать пару ключей SSH в подкаталоге .ssh/:

    1. cd ~
    2. cd .ssh/
    3. ssh-keygen -t ed25519 -C "<comment>"

    Затем просто нажмите Enter, чтобы закончить.

Добавить комментарий

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: