我在试着安装git服务器。当我将git用户的默认shell设置为/usr/bin/ git时,在以git身份登录时会出现错误。
fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
基于Ssh键的访问工作,权限设置正确。
Google搜索没有显示任何有关此错误的信息。
我在过去的安装中也使用了这个方法,并且没有显示这样的错误。此外,我还查看了工作服务器,如果它有一些额外的文件或配置,但没有这样的东西。
系统规范:
/etc/passwd线:
git:x:1002:1004::/home/git:/usr/bin/git-shell
发布于 2011-10-27 20:22:33
我在运行locate git-shell-commands
后发现了这个
cat /usr/share/doc/git-1.7.4.4/contrib/git-shell-commands/README示例程序可通过git-shell调用。将名为“git-shell -命令”的目录放在shell为git的用户的主目录中。然后,任何以用户身份登录的人都可以在‘git-shell-命令’目录中运行可执行文件。提供的命令:帮助:打印出可用命令的名称。当以交互方式运行时,git-shell将在启动时自动运行“帮助”,只要它存在。list:在用户的主目录下显示名称以".git“结尾的任何裸存储库。没有其他git存储库是可见的,尽管它们可能通过git-shell是可复制的。“list”的设计是为了尽量减少在查找可用存储库时对git的调用次数;如果您的安装程序有其他可以被用户发现的存储库,您可能希望相应地修改'list‘。
因此,我以root用户的身份运行了以下命令:
cp /usr/share/doc/git-1.7.4.4/contrib/git-shell-commands /home/git -R
chown git:developers /home/git/git-shell-commands/ -R
chmod +x /home/git/git-shell-commands/help
chmod +x /home/git/git-shell-commands/list
exit
然后,我能够以git
用户的身份运行以下操作:
[me@svn ~]$ su git
Password:
Run 'help' for help, or 'exit' to leave. Available commands:
list
git> help
Run 'help' for help, or 'exit' to leave. Available commands:
list
git> list
git> exit
现在我看不出有什么好的帮助和列表,但登录有效。:)
发布于 2013-10-31 22:48:31
我只需要做# mkdir ~git/git-shell-commands
,然后su git
为git 1.8.1.5-r1
工作
https://serverfault.com/questions/285324
复制相似问题