Git 安装 fatal: unrecognized command “/home/git/bin/gitolite-shell id_rsa“

2、错误2 上面的问题解决了,但是执行 git clone YourGitName@YourIP:gitolite-admin 还是报错,fatal: unrecognized command “/usr/share/gitolite/gl-auth-command admin"

这个命令找不到?直接在linux里面敲入,发现可以啊,又是什么鬼问题?尝试了很久,找了很多文档,以为是配置问题,其实还是安装git时候的遗留问题。 因为这个用户被设置不能登入,不能登入就是不能执行命令。 为什么不能登入,还记得安装git服务的时候那文章千篇一律的说:为了保证安全,将 /etc/passwd/中git用户登录改为 /usr/bin/git-shell 原本是 /bin/bash 这对gitolite来说就是一个坑,千万别跳进去。我跳了,你们别跳,特意记下来,改回原来的,一切ok!

fatal: unrecognized command '/home/git/bin/gitolite-shell id_rsa'
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

测试了按照上面的方法修改之后还是一样的错误。

使用下面方法解决了:应该是禁用git用户登录

sudo passwd -d git

参考:https://stackoverflow.com/questions/16046757/unable-to-disable-git-log-in-shell-to-prevent-shell-access

猜你喜欢

转载自blog.csdn.net/afgasdg/article/details/112512906