1

I ask to help with a strange error during my work with Git.

I've installed Gitosis. Here's my config:

cat /root/gitosis-admin/gitosis.conf 
[gitosis]
loglevel = DEBUG

[group gitosis-admin]
writable = gitosis-admin
members = admin

[group sugar-dev]
writable = sugar-dev
members = eyablokov

So I pointed one SSH key, "admin", to administering Gitosis. Also I've created "sugar-dev" repo and pointed another key as member. "admin" key is on one machine, and it's okay. Second, "eyablokov" key is an usual member key on my another machine. I plan use this key as dev only.

I've configured and pushed the changes into gitosis-admin repo by the normal way. Both keys are in keydir/ directory and was pushed remote also.

After this, on another machine, where "eyablokov" key is stored, I create a local directory: mkdir ~/Projects/sugar-dev. Enter into: cd ~/Projects/sugar-dev. Next: git init, and after: git remote add origin git@SERVER:sugar-dev.git. It's okay.

After I try, for example, add something and commit and push and have a problem:

echo 'Please, describe the project.' > DESCRIPTION
git add DESCRIPTION 
git commit -am "Added description file"

And git push origin master shows me

Pushing to git@SERVER:sugar-dev.git
fatal: cannot exec '/Users/gular/.ssh/eyablokov_dsa': Permission denied
fatal: unable to fork

I don't know what to do. git must to see my eyablokov, not eyablokov_dsa, key. dsa is another my key. I've tried to chmod, tried to move .ssh/config file, where is IdentityFile pointed to dsa key. Didn't help.

  • Now I'm waiting for another developer. I want to give him an access to sugar-dev with his key, and see what will be. I think it will be fine. – Evgenii Iablokov Feb 28 '13 at 05:54

1 Answers1

0

When you are working with an ssh-based git server (like gitosis, or better yet, gitolite since gitosis is obsolete and no longer maintained), you need a ~/.ssh/config file in order to specify the exact ssh key file names you want to use.
(also illustrated in "users are asked for password while using gitolite")

In your case:

Host eyablokov
    HostName SERVER 
    User git
    IdentityFile /Users/gular/.ssh/eyablokov

That allows you to use this kind of url:

git clone eyablokov:sugar-dev.git

On Windows, make sure you are using a git-cmd.bat instance (included with msysgit), which will correctly set your HOME environment variable (not set by default by Windows).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250