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)

  1. I added a test repo and a new user in the conf file in gitolite-admin.

  2. The new user created a new ssh key called newUser - the newUser.pub was added to keydir inside gitolite-admin

  3. The new users can connect via ssh to the Amazon AWS instance using the certificate meant for the Amazon instance

  4. 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 & 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

  • Can you copy the content of ~git/.ssh/authorized_keys ?
    – VonC
    Commented Jan 28, 2013 at 18:23
  • @VonC - thank you for commenting - I added the info for the user above
    – ali haider
    Commented Jan 28, 2013 at 18:35
  • I suppose that keyinfo is the long public ssh key? (in one line). If so, it is good. The issue should be on the client side, and an ssh will try to use id_rsa.pub, unless you are using a ~/.ssh/config file, as described in stackoverflow.com/questions/2931167/git-over-port-443/…, in which case you can reference any file you want.
    – VonC
    Commented Jan 28, 2013 at 19:20
  • @VonC - Yes it is - I added the second edit above. WhenI try connecting using the config file (I tried it earlier), it gave me the error copied above (i.e. "tilde_expand_filename: No such user"). I received the same error when I run the ssh-vvv command for the server.
    – ali haider
    Commented Jan 28, 2013 at 19:38
  • What url did you used for the git clone? With your configfile, it should be: git clone test.git.com:arepo.
    – VonC
    Commented Jan 28, 2013 at 20:06

1 Answer 1


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:

Host test.git.com amazonHostName 
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!

  • Je vous en prie. +1
    – VonC
    Commented Jan 29, 2013 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .