关闭ssh访问gitolite服务器时已认证用户可以列出所有仓库的方法

当客户A的公钥添加到gitolite服务器之后, 客户A用ssh去访问该服务器, 服务器会回应并列出所有的仓库。其中有些仓库是客户A不能访问的,比如客户B的仓库,但是他却能看到。这有可能会泄露商业机密。

 

如下:

$ ssh app@gitoliteserver

PTY allocation request failed on channel 0

hello customer_a, this is app@gitoliteserver running gitolite3 v3.6.6-9-gd6e8a0f on git 1.9.1

 

R W testing

R W customer_a/path/to/repo1

R W customer_a/path/to/repo2

R W customer_b/path/to/repo1

R W customer_b/path/to/repo2

Connection to gitoliteserver closed.

 

 

关闭的方法:

 

1. 安装之前在源码的位置修改:

diff --git a/src/commands/info b/src/commands/info
index 5079cfa..09d92f5 100755
--- a/src/commands/info
+++ b/src/commands/info
@@ -36,7 +36,7 @@ if ($json) {
 }

 print_patterns();     # repos he can create for himself
-print_phy_repos();    # repos already created
+#print_phy_repos();    # repos already created

 

 

2. 安装之后安装 目录修改

打开文件 ~bin/commands/info 注释以下这行

#print_phy_repos(); # repos already created

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值