Reputation: 479
I am trying to setup Redmine with gitolite and used this guide http://nsaunders.wordpress.com/2012/04/24/redmine-gitolite-integration/
Everything seems to be working fine, the repository is created through Redmine (I see the repository under gitolite/repositories). However, when I try to initialize the repository with the following commands, I keep getting the same error message
mkdir nwi
cd nwi
git init
touch readme.txt
git add readme.txt
git commit -m 'Initializing T repository'
git remote add origin gitolite@localhost:nwi.git
git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
The public key for the user is in the autohorized_keys for gitolite. The user is in gitolite.conf for the repository that I am trying to commit to. I am new to git, tried one thousand things and could not get it to work. What can be wrong?
Upvotes: 2
Views: 1252
Reputation: 786
generate your own keypair. As your own user execute
cd ~/.ssh ssh-keygen -t rsa username
Make sure that your public key (username.pub) is uploaded in the gitolite /keydir folder. Since you've bundled redmine with gitolite that probably means that redmine is managing these public keys and you would need to upload them to Redmine, so that Redmine can update the admin-repository. Please note that you cannot add keys manually, you'll need to commit and push them through the admin-repository (redmine should do that in your case)
Once your public key is registered in gitolite, try registering your own key in the system:
exec ssh-agent bash ssh-add ~/.ssh/private-key-name
Try connecting again
Upvotes: 1
Reputation: 311258
This is an ssh authentication problem more than a git problem. You would typically look in /var/log/secure
or similar to see why ssh is rejecting the connection. You want to make sure that:
authorized_keys
file,authorized_keys
file are 600
(rw-------
).ssh
directory are 700
(rwx------
)gitolite
userUpvotes: 1