0

I'm setting up a git server (on a RHEL 6 box).

I have created the git user and set its shell to /usr/bin/git-shell I have created a directory git-shell-commands in the user's home (/home/git) and chmod it to 755.

I downloaded the help and list commands from github, put them in git-shell-commands and made them executable.

I also set up the .ssh directory and authorized_keys.

Now on my box when I do ssh git@thegitserver I get the error

Last login: Thu Jun 13 11:56:07 2013 from 192.168.1.2
fatal: What do you think I am? A shell?
Connection to 192.168.1.3 closed.

What else is there to do to make it interactive?

Jistanidiot
  • 54,334
  • 4
  • 18
  • 29

2 Answers2

0

So this is a git version issue. The version that comes with RHEL 6 (1.7.1) is too old to properly work with the git-shell-commands directory. Upgrading to 1.8 solved this.

Jistanidiot
  • 54,334
  • 4
  • 18
  • 29
-1

The man page of git-shell describes exactly this case. You need to create a directory called ~/git-shell-commands. In this directory you put files with the commands you want to use.

Why do you want to do this anyways? If you want to setup a git server, gitolite is the best solution I know.

arnej
  • 11
  • 1
  • As I mentioned in my question, I have created the git-shell-commands directory and put in the help and list commands from the git repo on github. It isn't working. As for gitolite, I am aware of it, but really just want this limited access not anything complex like gitolite. – Jistanidiot Jun 17 '13 at 15:43
  • Gitolite isn't necessary, you can already create shared bare git repos and use linux acls, user accounts, git's pre-receive hook to make your own secure git over SSH workflow. At least, it will gives you knowledge about Git, which is useful before switching to any more advanced project. –  Dec 04 '15 at 10:29