LINUX.ORG.RU

Gitlab + ssh on Arch

 , ,


0

1

После установки и настройки Gitlab на арче не могу подключиться по ssh к пользователю git с использованием ключей (добавляю через веб интерфейс). При попытке сделать git push выдает ошибку, что не может прочитать из удаленного репозитория. Push по средствам http работает отлично. Ситуация возникает только под арчем (установка по гайду по ubuntu заводится с пол тычка). Проблема повторяемая и возникает при каждой установке по этой схеме. Для развертки использую домашний сервер (i7 2600k, 16 гигов памяти и ssd) и сервера у digitalocean.com (тариф за 10 долларов с 1 гигом оперативки, базовый образ Arch Linux 2013.05 x64).

Кто нибудь сталкивался с похожей ситуацией? Если да, то как решали? Вариант смены арча на убунту не интересен. Заранее спасибо.

Гайд по которому устанавливаю:

https://github.com/gitlabhq/gitlabhq/blob/6-5-stable/doc/install/installation.md

Набор пакетов при установке:

sudo pacman -S sudo base-devel zlib libyaml openssl gdbm readline ncurses libffi curl git openssh redis checkinstall libxml2 libxslt icu python2 python-docutils nginx mariadb ruby

gemrc: --no-user-install

Скрипты для systemd беру по ссылкам:

gitlab.target

gitlab-sidekiq.service

gitlab-unicorn.service

$ git push -u origin master              
Enter passphrase for key '/c/Users/*****/.ssh/id_rsa':
fatal: Could not read from remote repository.

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

Подключение к серверу по ssh c оффтопика(пробовал также с ноута с арчем результат тот же)

$ ssh -vT git@*****
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to ***** [*****] port 22.
debug1: Connection established.
debug1: identity file /c/Users/*****/.ssh/identity type -1
debug1: identity file /c/Users/*****/.ssh/id_rsa type 1
debug1: identity file /c/Users/*****/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '*****' is known and matches the RSA host key.
debug1: Found key in /c/Users/******/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/*****/.ssh/identity
debug1: Offering public key: /c/Users/*****/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/c/Users/*****/.ssh/id_rsa':
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
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.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.4 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1

cat /home/git/.ssh/authorized_keys

command="/home/git/gitlab-shell/bin/gitlab-shell key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa ******** ****@*****

Gitlab check

[root@arch-gitlab 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: ...
Administrator / 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.8.4
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? ... no
  Try fixing it:
  Install the init script
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors
projects have namespace: ...
Administrator / test ... yes
Projects have satellites? ...
Administrator / 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

Gitlab info

[root@arch-gitlab gitlab]# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:         Arch Linux
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.5.1
Revision:       6f6f158
Directory:      /home/git/gitlab
DB Adapter:     mysql2
URL:            http://localhost
HTTP Clone URL: http://localhost/some-project.git
SSH Clone URL:  git@localhost: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

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

Jan 27 07:47:13 gitlab sshd[6435]: debug1: Forced command (key option) '/home/git/gitlab-shell/bin/gitlab-shell key-1'
Jan 27 07:47:13 gitlab sshd[6435]: debug2: fd 3 setting TCP_NODELAY
Jan 27 07:47:13 gitlab sshd[6435]: debug3: packet_set_tos: set IP_TOS 0x08
Jan 27 07:47:13 gitlab sshd[6435]: debug2: fd 10 setting O_NONBLOCK
Jan 27 07:47:13 gitlab sshd[6435]: debug2: fd 9 setting O_NONBLOCK
Jan 27 07:47:13 gitlab sshd[6437]: debug3: Copy environment: MAIL=/var/spool/mail/git
Jan 27 07:47:13 gitlab sshd[6435]: debug2: fd 12 setting O_NONBLOCK
Jan 27 07:47:13 gitlab sshd[6437]: debug3: Copy environment: XDG_SESSION_ID=11
Jan 27 07:47:13 gitlab sshd[6437]: debug3: Copy environment: XDG_RUNTIME_DIR=/run/user/1000
Jan 27 07:47:13 gitlab sshd[6435]: debug1: Received SIGCHLD.
Jan 27 07:47:13 gitlab sshd[6435]: debug1: session_by_pid: pid 6437
Jan 27 07:47:13 gitlab sshd[6435]: debug1: session_exit_message: session 0 channel 0 pid 6437
Jan 27 07:47:13 gitlab sshd[6435]: debug2: channel 0: request exit-status confirm 0
Jan 27 07:47:13 gitlab sshd[6435]: debug1: session_exit_message: release channel 0
Jan 27 07:47:13 gitlab sshd[6435]: debug2: channel 0: write failed

ImperialDwarf ()
Ответ на: комментарий от ImperialDwarf

Ошибка была в этапе создания пользователя (использовал «useradd -m -s /bin/false git») вместо useradd -m git.

ImperialDwarf ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.