gitlab-shell : Disallowed command

标签 git shell ssh gitlab

我已经在 Ubuntu 14.04 上安装了最新版本的 GitLab,除了推送到远程外,它工作正常。

运行 ssh git@example.com "git-receive-pack repo.git" 运行良好。在 ~/gitlab-shell/gitlab-shell.log 中,结果是

INFO -- : gitlab-shell: executing git command git-receive-pack repo.git for user with key key-1.

但是当我运行 git push 时,日志显示:

WARN -- : gitlab-shell: Attempt to execute disallowed command git receive-pack 'repo.git' by user with key key-1.

输出是:

fatal: protocol error: bad line length character: Disa

ssh git@example.com "git receive-pack repo.git" 的输出是

"Disallowed command"

所以允许和不允许之间的区别是缺少破折号。

我的 git 版本:

  • 本地 git 版本:2.2.1 (OS X)
  • 远程 git 版本:1.9.1 (Ubuntu 14.04)

我该如何解决?有配置参数吗?

最佳答案

我一直遇到同样的问题,编辑 ~/.gitconfig 解决了这个问题。

在过去的某个时间,某些东西修改了我的本地 ~/.gitconfig 文件并插入了这个条目:

[remote "origin"]
        receivepack = git receive-pack

我修改成如下,现在一切正常。

[remote "origin"]
        receivepack = git-receive-pack

关于gitlab-shell : Disallowed command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29588258/

相关文章:

git - 从多个 pull ,仅 push 一个

android - Linphone Android 导入和构建

linux - 我想转到一个文件并根据文件中存在的文件名和关键字获取值?

bash - 使用 ssh 和 EOF 在 bash 脚本中将变量传递给远程主机

ssh - 远程访问云9

git - Visual Studio 2013 中的 Git 客户端是 "offline"

Git fetch 在 for-each-ref 中不显示远程分支

android - 什么是 dexopt? (Android shell 命令)

linux - Git Pull 无需输入私钥密码

python - Ansible 由于其构建的 ssh 问题而挂起