linux - 在 Debian 服务器上通过 ssh 连接到 Git 用户时没有(自定义)答案

标签 linux git shell

在设置 Git 服务器(在最新的 Debian 上)时,我将 git 用户 shell 设置设置为“git-shell”(...:/home/git:/usr/bin/git-shell),期望 ssh 连接到 git@xxx.xxx.xxx.xxx 的响应将类似于:

fatal: What do you think I am? A shell?
Connection to gitserver closed.

实际的响应是:

$ ssh git@xxx.xxx.xxx.xxx
Linux Debian-70-wheezy-32-minimal 3.2.0-4-686-pae #1 SMP Debian 3.2.46-1+deb7u1 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 15 00:29:15 2013 from .....
fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
Connection to xxx.xxx.xxx.xxx closed.

我怎样才能将其更改为另一个 - 正式答案或根本没有答案?

最佳答案

您只需更改 SSH header 。要禁用它,您需要编辑

/etc/ssh/sshd.conf

要进行编辑,您需要执行以下操作

rm /etc/motd
vi /etc/motd

您首先需要删除它,因为它是定期动态创建的

关于linux - 在 Debian 服务器上通过 ssh 连接到 Git 用户时没有(自定义)答案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19412431/

相关文章:

c 中的复制实用程序(如 *NIX 中的 cp),无法复制 mp4 或 mp3 文件

linux - curlftpfs 错误地复制文件/目录名

git - 推送失败后如何撤消提交?

c# - 编写具有远程 shell 功能的程序,如 netcat

linux - Shell 脚本自动回答 Yes No 对话框

python - 递归搜索文件和子​​文件夹名称中的字符串列表

c++ - 在两个独立的程序之间传递信息

git - 如何从 git 索引中删除已修改的文件并一步放弃修改?

android - 如何配置 Android Studio 在文件末尾添加新行?

linux - 从 ls 输出中提取文件名和修改时间