Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Giving Linux user git access but not shell access? [closed]

Tags:

git

linux

ssh

I want to give commit access to several different people, each to their own separate git repository on my Linux server.

One way to do this would be:

foreach user x
    adduser x
    create /home/x/repo.git
    ask user x to clone from ssh://myserver.com/home/x/repo.git

However this has the undesirable effect that they could also login via ssh. I do not want to give them shell access.

Is there anyway to set it up in a similar way, but purely give them git commit access and not shell access?

like image 735
Andrew Tomazos Avatar asked Feb 25 '13 11:02

Andrew Tomazos


1 Answers

Set /usr/bin/git-shell as their shell in /etc/passwd.

Or use native git protocol instead of ssh.

like image 115
Maxim Egorushkin Avatar answered Nov 03 '22 22:11

Maxim Egorushkin