这里不是仅仅把git的登陆shell改成git-shell就可以了……这样你用ssh登陆上去会打印
fatal: Interactive git shell is not enabled. hint: ~/git-shell-commands should exist and have read and execute access.
不能正常的使用git-shell的功能,这是官网的指示,应该手动建立~/git-shell-commands/no-interactive-login文件
以git登陆后
$ chsh -s /usr/bin/git-shell $ mkdir $HOME/git-shell-commands $ cat >$HOME/git-shell-commands/no-interactive-login <<\EOF #!/bin/sh printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not" printf '%s\n' "provide interactive shell access." exit 128 EOF $ chmod +x $HOME/git-shell-commands/no-interactive-login
第一句是改变登陆shell,不过我在树莓派上测试了发现会提示git-shell不合法,那就手动改/etc/passwd
直接改成git-shell确实有问题,我这边是不能push到git服务器。 官网的提示在哪里?能给个链接看看吗?
Sign in to make a reply
0Yinf
这里不是仅仅把git的登陆shell改成git-shell就可以了……这样你用ssh登陆上去会打印
不能正常的使用git-shell的功能,这是官网的指示,应该手动建立~/git-shell-commands/no-interactive-login文件
以git登陆后
第一句是改变登陆shell,不过我在树莓派上测试了发现会提示git-shell不合法,那就手动改/etc/passwd