These are the steps I followed for setting up a new user on gitolite hosted on amazon aws: 1. Installed gitolite (works - I can can connect as admin & add new repos/users)
I added a test repo and a new user in the conf file in gitolite-admin.
The new user created a new ssh key called newUser - the newUser.pub was added to keydir inside gitolite-admin
The new users can connect via ssh to the Amazon AWS instance using the certificate meant for the Amazon instance
I ran the following:
git add -A git commit -m 'adding new repo and user' git push origin master
The response mentioned that the new users and repos have been generated. However, when the user connects, the ssh fails to authenticate. I ran the ssh -vvv for the git instance i.e. ssh -vvv git@server name (where server name is the amazon instance). I can see that the ssh attempt is not picking the new public key but instead trying to use the older id_rsa.pub file. I will now try to force ssh to use the new key - any other suggestions to help troubleshoot this will be greatly appreciated!
Edit: Thanks @VonC for responding. I have copied the authorized key info for the user below below:
command="/usr/share/gitolite/gl-auth-command adavid",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa keyinfo [email protected]
where adavid is the user added, abcdavid is the userID on the user's computer & 192.168.1.3 is the local address for the user's computer.
Second Edit:
I had the user add a config file as well:
Host test.git.com
HostName amazon host name
User adavid (where adavid is the user name)
PreferredAuthentications publickey
IdentityFile ~./ssh/adavid (where adavid is the user name and associated with the key called adavid)
I received the following error when cloning into the git repo:
Cloning into git repository name
tilde_expand_filename: No such user .
fatal: The remote end hung up unexpectedly
I am checking the git command now to see if I made any mistake. thanks
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
I had the user connect via ssh (using the ssh certificate file) - the user accepted the key for the connection to their computer. The user added a config file into their ~./ssh file in the following format:
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!