gitlab-shell:不允许的命令 [英] gitlab-shell: Disallowed command
问题描述
我已经在Ubuntu 14.04上安装了最新版本的GitLab,除了推送到远程外,它工作正常。
运行 ssh git @ example.comgit-receive-pack repo.git
效果很好。在〜/ gitlab-shell / gitlab-shell.log中,结果是:
lockquote
INFO - :gitlab-shell:执行git命令git-使用key-1接收用户的repo.git。
但是当我运行 git push
,日志说:
WARN - :gitlab-shell:尝试执行不允许的命令git receive -b''repo.git'用户使用key-1。
输出结果为:
fatal:协议错误:坏行长度字符:Disa
输出 ssh git@example.comgit receive-pack repo.git
是
不允许的命令
因此,允许和禁止之间的差异是缺少的短划线。
我的git版本:
- 本地git版本:2.2.1(OS X)
- 远程git版本:1.9.1(U buntu 14.04)
我该如何解决这个问题?是否有配置参数?
我一直有同样的问题,并编辑〜/ .gitconfig解决了这个问题。 / p>
过去的某些时间,修改了我的本地〜/ .gitconfig文件并插入了这个条目:
[remoteorigin]
receivepack = git receive-pack
我将它修改为以下内容,现在一切正常。
[remoteorigin]
receivepack = git-receive-pack
I've installed the recent version of GitLab on Ubuntu 14.04 and it works fine except pushing to the remote.
Running ssh git@example.com "git-receive-pack repo.git"
works well. In ~/gitlab-shell/gitlab-shell.log, result is
INFO -- : gitlab-shell: executing git command git-receive-pack repo.git for user with key key-1.
But when I'm running git push
, the log says:
WARN -- : gitlab-shell: Attempt to execute disallowed command git receive-pack 'repo.git' by user with key key-1.
And the output is:
fatal: protocol error: bad line length character: Disa
The output of ssh git@example.com "git receive-pack repo.git"
is
"Disallowed command"
So the difference between allowed and disallowed is a missing dash.
My git versions:
- Local git version: 2.2.1 (OS X)
- Remote git version: 1.9.1 (Ubuntu 14.04)
How can I fix that? Is there a config param?
I have been having the same problem, and editing ~/.gitconfig solved the problem.
Something, at some time in the past, had modified my local ~/.gitconfig file and inserted this entry:
[remote "origin"]
receivepack = git receive-pack
I modified it to the following, and now everything works well.
[remote "origin"]
receivepack = git-receive-pack
这篇关于gitlab-shell:不允许的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!