给Linux用户git访问但不是shell访问? [英] Giving Linux user git access but not shell access?

查看:167
本文介绍了给Linux用户git访问但不是shell访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给几个不同的人提交访问权限,每个人都在我的Linux服务器上为他们自己单独的git仓库提供访问权。



一种方法是: / p>

  foreach user x 
adduser x
create /home/x/repo.git
ask用户x从ssh克隆://myserver.com/home/x/repo.git

然而,这有其不利的影响,他们也可以通过SSH登录。我不想给他们shell访问权。



有没有办法以类似的方式设置它,但纯粹给他们git提交访问,而不是shell访问? / p>

解决方案

设置 / usr / bin / git-shell 作为它们在 / etc / passwd的



或者使用本机 git 协议而不是 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?

解决方案

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

Or use native git protocol instead of ssh.

这篇关于给Linux用户git访问但不是shell访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆