虽然git是分布式的版本管理系统,但对于团队项目开发,通常还是会在单独的服务器上创建一个git server。类似于svn,git server也有好几种配置方式。详情,可以参见git的文档http://*gi*t-sc*m.com/book/en/v2。这里,主要是从上述文档中摘出一部分,说明一下git-shell的用处。
假如,大家都使用ssh的方式来访问:
$ git clone [email protected]:project.git
这就意味者,访问者具有权限可以ssh登陆到服务器上:
$ ssh [email protected]
出于安全的考虑,我们最好限制用户只能进行git push/pull,但无法登陆。这可以使用git-shell来完成。
查看一下git-shell的位置:
$ which git-shell
/usr/bin/git-shell
将git-shell的路径添加到/etc/shells文件中,然后修改git用户的shell:
$ sudo chsh git
设置为/usr/bin/git-shell。这样,如果再使用ssh方式登陆,则会报错:
$ ssh [email protected]
[email protected]'s password:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-35-generic x86_64)
* Documentation: https://help.ubuntu.com/
fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
Connection to 10.3.0.99 closed.
PicACG/哔咔漫画网页版入口地址-PicACG/哔咔漫画最新可用的网页版入口地址
126.com免费邮箱快速登录-126邮箱网页版一键登入
e站ehviewer网页版直达-ehviewer官网最新进入口
漫蛙官网入口免费下载最新版本-漫蛙漫画app安卓苹果双端安装包获取
谷歌浏览器手机版官方下载2024最新安装包-谷歌安卓手机浏览器最新版官方下载入口
jmcomic网页版最新入口-jmcomic网页版解锁入口