Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Git with SSH for Phabricator

I'm trying to configure SSH for Phabricator to get git running. I've followed this manual but when I call echo {} | ssh [email protected] conduit conduit.ping I always get an empty result or Permission denied (publickey,keyboard-interactive)..

/etc/ssh-phabricator/sshd_config:

AuthorizedKeysCommand /usr/libexec/ssh-phabricator-hook
AuthorizedKeysCommandUser git

Port 22
Protocol 2
PermitRootLogin no
AllowAgentForwarding no
AllowTcpForwarding no
PrintMotd no
PrintLastLog no
PasswordAuthentication no
AuthorizedKeysFile none

/etc/passwd:

phd:x:999:999::/var/tmp/phd:/bin/false
git:x:1005:1005::/home/git:/bin/bash

/etc/shadow:

phd:!:16135::::::
git:NP:16135:0:99999:7:::

/etc/sudoers:

git ALL=(phd) SETENV: NOPASSWD: /usr/bin/git-upload-pack, /usr/bin/git-receive-pack, /bin/false

~/.ssh/config:

Host phabricator.mydomain.com
    HostName phabricator.mydomain.com
    Port 22
    IdentityFile /c/Users/.../.ssh/id_rsa_phabricator
    PreferredAuthentications publickey
    User git

UPDATE

The reasons for my problems were:

  • I didn't use the SSH key with the client.
  • I didn't ensure that the git user has a shell.
like image 393
witrin Avatar asked Mar 06 '14 21:03

witrin


1 Answers

Just another thing to note is the path must have the correct permissions for the AuthorizedKeysCommand or this could also result in

Permission denied (publickey,keyboard-interactive)
like image 116
Alasdair Avatar answered Sep 27 '22 18:09

Alasdair