I was able to run the following command:
git clone admin@ip address:gitolite-admin.git
When I tried adding a new user using the steps below, the new user was unable to connect:
Steps taken so far:
1. Copied the public key into the keydir (also tried copying it in a separate directory within the keydir)
2. I added a repo in the config file for the new userID
3. git add -A
4. git commit -m 'adding new user keys and repo'
5. git push origin master
All these commands run without throwing any errors.
When the user tries to login, he is unable to connect with the following command:
git clone username@IPAddress:newRepoName.git
The connection times out complaining about unable to connect on port 22. Any suggestions to help troubleshoot this (the public key for the user was generated from his computer - same one is being used for logging in as user - different computer was used for admin access). Thanks in advance
Edit: I removed the public key for a (non-admin) user, ran commit and pushed to the server after which I added a new public key for the user, ran add, commit & pushed to server. The response for the admin mentioned that the user was added. However, when the user tries connecting to the server using the command below, the connection attempt is unsuccessful (I can clone the project from my computer - the additional user cannot, neither can any other user so I am guessing I made a mistake in configuring additional users - any thoughts would be quite welcome and thanks for the patience)
git clone [email protected]:testProject Cloning into 'testProject'... Permission denied (publickey). fatal: The remote end hung up unexpectedly
This address won't ever work:
git clone username@IPAddress:newRepoName.git
When using gitolite, you always use the same account:
(if git is the account under which gitolite is installed)
See "adding and removing users" to understand how to declare a new user:
Ie adding his/her public key named after the user id in the
gitolite.conf
file.Then the user must have his/her keys in
~/.ssh/id_rsa(.pub)
, and make any git command withgit@IPAddress:newRepoName.git
(git
, notusername
)The issue was with the client setup for connecting to the amazon aws instance hosting git. I have accepted VonC's response since he was very responsive to all my questions.Thanks
The user added a config file into their ~./ssh file in the following format:
Host test.git.com
HostName amazonHostName
User adavid
PreferredAuthentications publickey
IdentityFile ~./ssh/adavid
The user ran the ssh-add command as well. However, they were not able to connect to the git repository using the short name and had to use the long name for the connection.
Once again - Merci beaucoup VonC!
For others having the same problem, check whether AllowGroups is in use for ssh on the server. Might be the git-user on the server isn't in the correct group.
Diagnosis: attempt to ssh to the git-user on the server, and see what turns up in /var/log/auth.log If it says "User git from not allowed because none of user's groups are listed in AllowGroups", you need to check which groups are in AllowGroups and then add the git user to one of those.