Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I tried setting up git-shell on our CentOS (6.4) system (after getting this working correctly on Ubuntu 13.10, maybe cross platform hot mess?)

my /etc/passwd shows

git:x:500:500:Web Archive VCS:/home/git:/usr/bin/git-shell

and my shell commands are in /home/git/git-shell-commands

[root@domain git]# cd /home/git/git-shell-commands/ && tree
.
├── addkey
├── create
├── drop
├── help
└── list

But ssh'ing in is still giving me

Last login: Fri Nov 15 12:14:49 2013 from localhost
fatal: What do you think I am? A shell?
Connection to localhost closed.

I am working off of this resource

http://planzero.org/blog/2012/10/24/hosting_an_admin-friendly_git_server_with_git-shell

There was some confusion that this was licensed GIT commands (push/pull etc) but this is a restricted shell with pre set commands! Please anyone reading this make note ;)

Installer script if you want to see steps

https://github.com/ehime/bash-tools/blob/master/git-server-setup.sh

EDIT

I still have not been able to resolve this over the weekend, I HAVE added

# add to shells
echo '/usr/bin/git-shell' >> /etc/shells

# Prevent full login for security reasons
chsh -s /usr/bin/git-shell git

And have double checked that GIT Shell actually exists in /usr/bin

[root@domain bin]# ll /usr/bin | grep git
-rwxr-xr-x. 105 root root    1138056 Mar  4  2013 git
-rwxr-xr-x.   1 root root    1138056 Mar  4  2013 git-receive-pack
-rwxr-xr-x.   1 root root     457272 Mar  4  2013 git-shell
-rwxr-xr-x.   1 root root    1138056 Mar  4  2013 git-upload-archive
-rwxr-xr-x.   1 root root     467536 Mar  4  2013 git-upload-pack

This IS a root account that I am dealing with though, could that have something to do with it?

share|improve this question

1 Answer 1

As it turns out, this feature has been introduced in git 1.7.4. git --version gave me 1.7.1 on a base CentOS 6.4 install so that was the beginning of the issue =/

If you experience this problem, check your git version. Here's is an updater script that I wrote to aid you in your troubles.

#!/bin/bash
# Git updater for RHEL systems

# CPR : Jd Daniel :: Ehime-ken
# MOD : 2013-11-18 @ 09:28:49

# REF : http://goo.gl/ditKWu
# VER : Version 1.1

# ROOT check
if [[ $EUID -ne 0 ]]; then
  echo "This script must be run as su" 1>&2 ; exit 1
fi

yum install -y perl-ExtUtils-MakeMaker gettext-devel expat-devel curl-devel zlib-devel openssl-devel
cd /usr/local/src

git clone git://git.kernel.org/pub/scm/git/git.git && cd git
make && make prefix=/usr install

git --version
exit 0

Thanks to everyone who took the time to look into this, I appreciate it greatly.

share|improve this answer

Your Answer

 
discard

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.