Git Server
来源:互联网 发布:淘宝mac版官方下载 编辑:程序博客网 时间:2024/06/07 13:01
在前面的文章中,为大家介绍了如何自己架设一个git
服务器并建立一个名为git
的用户来进行所有的git
操作。
那么如果我们想限制git
用户,禁止其进行SSH
登陆进行操作,我们可以将git
用户的shell
换成git-shell
这个工具:
$ cat /etc/shells # see if `git-shell` is already in there. If not...$ which git-shell # make sure git-shell is installed on your system.$ sudo vim /etc/shells # and add the path to git-shell from last command
我们看到,首先需要找到git-shell
的安装位置,如果没有被添加在/etc/shells中,我们需要手动将其添加进去(通常git-shell
在/usr/bin/git-shell
中)。
接下来,我们就可以把默认的shell
替换成git-shell
了:
$ sudo chsh git -s $(which git-shell)
现在,git
用户只能使用SSH
连接来进行push
和pull
,而不能用来登陆服务器了。
$ ssh git@gitserverfatal: Interactive git shell is not enabled.hint: ~/git-shell-commands should exist and have read and execute access.Connection to gitserver closed.
阅读全文
0 0
- GIT server
- git server
- git server
- Git Server
- git server
- Git Server
- git submit remote git server
- Ubuntu server 搭建Git server
- git-server deploy
- git server搭建
- GIT server build up
- GIT SSH Repository Server
- RedHat配置git server
- Git Server init
- 关于git server 搭建
- 搭建git server
- RedHat配置git server
- git server配置总结
- 数组中的逆序对数
- eventbus使用
- [Unity&Photon]在Unity&Photon基础上如何实现简单的右键移动
- VSFTP的安装
- lucene实例
- Git Server
- 数据库表设计,没有最好只有最适合
- [YTU]_2917(Shape系列-3)
- 一个比较有趣的题:推算今天星期几
- 常用linux日志查询命令
- mybatis-分步查询方式传递多列的值-16
- bzoj2152 聪聪与可可 点分治
- Android隐藏软键盘
- 导航区不变内容区变