redmine_git_hosting icon indicating copy to clipboard operation
redmine_git_hosting copied to clipboard

git push -u origin master -> Permission denied (publickey).

Open linuxmail opened this issue 10 years ago • 1 comments

hi,

I have Debian Wheezy with Chiliproject and with your plugin enabled. Most parts are working, but if I create a new project in Chili and want to push a new git to the project, it ends up with "Permission denied (publickey)."

I uploaded my SSH key to the account settings and I can see my key in "/tmp/redmine_git_hosting/gitolite-admin/keydir/" and the config in "/tmp/redmine_git_hosting/gitolite-admin/conf/gitolite.conf". But I wonder, where SSHD can find the keys. I assume, that there must be a hook, that writes the key to "/var/lib/gitolite/.ssh/authorized_keys" or something else. Correct?

Oct  8 18:20:25 install sshd[14380]: debug1: userauth-request for user git service ssh-connection method none [preauth]
Oct  8 18:20:25 install sshd[14380]: debug1: attempt 0 failures 0 [preauth]
Oct  8 18:20:25 install sshd[14380]: debug1: userauth-request for user git service ssh-connection method publickey [preauth]
Oct  8 18:20:25 install sshd[14380]: debug1: attempt 1 failures 0 [preauth]
Oct  8 18:20:25 install sshd[14380]: debug1: test whether pkalg/pkblob are acceptable [preauth]
Oct  8 18:20:25 install sshd[14380]: debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
Oct  8 18:20:25 install sshd[14380]: debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
Oct  8 18:20:25 install sshd[14380]: debug1: temporarily_use_uid: 114/119 (e=0/0)
Oct  8 18:20:25 install sshd[14380]: debug1: trying public key file /var/lib/gitolite/.ssh/authorized_keys
Oct  8 18:20:25 install sshd[14380]: debug1: fd 4 clearing O_NONBLOCK
Oct  8 18:20:25 install sshd[14380]: debug1: restore_uid: 0/0
Oct  8 18:20:25 install sshd[14380]: debug1: temporarily_use_uid: 114/119 (e=0/0)
Oct  8 18:20:25 install sshd[14380]: debug1: trying public key file /var/lib/gitolite/.ssh/authorized_keys2
Oct  8 18:20:25 install sshd[14380]: debug1: Could not open authorized keys '/var/lib/gitolite/.ssh/authorized_keys2': No such file or directory
Oct  8 18:20:25 install sshd[14380]: debug1: restore_uid: 0/0
Oct  8 18:20:25 install sshd[14380]: Failed publickey for git from 192.168.1.10 port 53200 ssh2

Some Debug too:

ct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "hooks.redmine_gitolite.url"\ "http://install/githooks/post-receive"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "--bool"\ "hooks.redmine_gitolite.debug"\ "true"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "--bool"\ "hooks.redmine_gitolite.asynch"\ "true"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "--git-dir=repositories/denny-test-12.git"\ "config"\ "hooks.redmine_gitolite.key"\ "SOTAXGUVWBKNPSKFCIUCPCQXMCIMJMAMGGYGSSJNOMJLVUDCXWAMBBXYRULPPTTHDNFFHVEISTWJAOPGOYKPPTMN"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "--git-dir=repositories/denny-test-12.git"\ "config"\ "hooks.redmine_gitolite.projectid"\ "denny-test-12"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "hooks.redmine_gitolite.url"\ "http://install/githooks/post-receive"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "--bool"\ "hooks.redmine_gitolite.debug"\ "true"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "config"\ "--global"\ "--bool"\ "hooks.redmine_gitolite.asynch"\ "true"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "--git-dir=repositories/denny-test-12.git"\ "config"\ "hooks.redmine_gitolite.key"\ ""\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git Oct 8 18:23:44 install sudo: chiliproject : TTY=unknown ; PWD=/srv/www/chiliproject-3.8.0 ; USER=git ; COMMAND=/bin/bash -c eval git\ "--git-dir=repositories/denny-test-12.git"\ "config"\ "hooks.redmine_gitolite.projectid"\ "denny-test-12"\ Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session opened for user git by (uid=0) Oct 8 18:23:44 install sudo: pam_unix(sudo:session): session closed for user git

any suggestions?

linuxmail avatar Oct 08 '13 16:10 linuxmail

hi,

I've got it, yesterday :-)

Problem was, that ~git/.gitolite/conf/gitolite.conf had the user "git" for accessing gitolite-admin and also ~git/.gitolite/conf/gitolite.conf-precompiled. After searching a lot and change in "gitolite.conf-precompiled" the user "git", to "id_rsa", I was able to checkout gitolite-admin, but it was working only once, because it was all changed back to user "git". The solution was, to rename the SSH key from "id_rsa/+pub" to "git/+pub" and adding them via gl-setup git.pub. After all ... it works now!

Thanks a lot :-)

linuxmail avatar Oct 09 '13 06:10 linuxmail