tags:

views:

396

answers:

2

I am trying to install gitosis on my server but keep getting the error "Username contains not allowed characters"

sudo -H -u git gitosis-init < /tmp/id_rsa.pub

with the username "[email protected]".

Any fix for this?

I am on a Mac and trying to install gitosis on Snow Leopard.

Update

I changed the username in the public key to [email protected] and it worked. Probably it's a problem with the hyphen sign. After installing I tried this

git clone [email protected]:gitosis-admin.git
cd gitosis-admin

but it fails saying

fatal: 'gitosis-admin.git': unable to chdir or not a git archive

Any ideas about what I may be doing wrong?

This is the guide I followed: http://nfocipher.com/index.php?op=ViewArticle&amp;articleId=12&amp;blogId=1

A: 

Is this related to the public key format, as described in this thread?

(I know it refers to a Window installation and you are on a Unix server, but the idea remains valid)

I figured that PuttyGen had generated an SSH2 public key file in a slightly different format, and ‘git gitosis-init’ wanted a user name at the beginning, so I went here:

http://www.rfc-archive.org/getrfc.php?rfc=4716

and saw that I could keep the “--BEGIN…” and “--END” parts, and replace the “comment: ...” line (generated by PuttyGen) with a line reading:

subject: git

And it worked! I got the output:

Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/

You can also try to copy just the key, as in this thread:

It's work fine for my ssh-pubkey on rawhide. I assume you have the wrong file format.
Try to copy id_rsa.pub key only (without comments, etc), run sudo -H -u gitosis gitosis-init, paste pubkey, then ^D.

VonC
I am on a Mac trying to install Gitosis on CentOS. I tried copy/pasting the key but it says sudo: no passwd entry for gitosis!
Abhinav
Ok. Was using 'gitosis' in the command instead of 'git'. It's still saying Username contains not allowed characters.
Abhinav
A: 

Had same problem. Turns out it was because username started with a number.

Aren Cambre
Hmm. I don't think my username started with a number. I'll check again. Thanks for the tip!
Abhinav