Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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 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 abcdavid@

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:

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

share|improve this question
Can you copy the content of ~git/.ssh/authorized_keys ? – VonC Jan 28 '13 at 18:23
@VonC - thank you for commenting - I added the info for the user above – ali haider Jan 28 '13 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, unless you are using a ~/.ssh/config file, as described in…, in which case you can reference any file you want. – VonC Jan 28 '13 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 Jan 28 '13 at 19:38
What url did you used for the git clone? With your configfile, it should be: git clone – VonC Jan 28 '13 at 20:06
up vote 1 down vote accepted

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 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!

share|improve this answer
Je vous en prie. +1 – VonC Jan 29 '13 at 21:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.