password problem with git clone gitosis@host:gitosis-admin.git

rama picture rama · Jun 17, 2009 · Viewed 19.2k times · Source

I'm confronted with some problems when trying to configure gitosis on Ubuntu. When i run this command

git clone gitosis@host:gitosis-admin.git

For my local machine i used git clone [email protected]:gitosis-admin.git where 59.80.70.68 is the ip of the server. But I get a password problem. I tried entering password of the server machine, but it fails

Kindly help me.

Answer

Phil Miller picture Phil Miller · Sep 1, 2009

Gitosis never works with passwords. It always uses SSH keys. You need to configure the use of whatever public key goes with the private key you gave it when you ran gitosis-init. You would do this by editing ~/.ssh/config to include a stanza like

Host githost # hostname you use on the commandline, in git remotes, etc.
HostName 12.34.56.78 # actually IP address or DNS name to connect to
User gitosis
IdentityFile ~/.ssh/id_rsa # whatever file stores the private key matching the public key you gave gitosis