SSH:更改用户外壳后“权限被拒绝”

fun*_*ter 6 shell ssh git

我有一个 SSH 服务器在我的 Raspberry PI 上运行,带有 ALARM(最新)。我的用户“gitroot”旨在使用 git-shell。但是,当我将/usr/bin/git-shellgitroot设置为 shell 时/etc/passwd,我无法再使用该用户登录。su - gitroot按预期工作。当我将 shell 更改为 时/bin/bash,我可以通过 ssh 以 gitroot 身份登录。

的权限/usr/bin/git-shell/bin/bash是相同的。我尝试更改密码,它没有改变任何东西。输出journalctl -f

Jul 23 09:05:27 netberry sshd[4213]: pam_unix(sshd:auth): authentication failure;logname= uid=0 euid=0 tty=ssh ruser= rhost=localhost.localdomai...r=gitroot
Jul 23 09:05:40 netberry sshd[4213]: Failed password for gitroot from 127.0.0.1 port 51969 ssh2
Jul 23 09:07:25 netberry sshd[4213]: Connection closed by 127.0.0.1 [preauth]
Jul 23 09:07:29 netberry sshd[4222]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=localhost.localdomai...r=gitroot
Jul 23 09:07:43 netberry sshd[4222]: Failed password for gitroot from 127.0.0.1 port 51970 ssh2
Jul 23 09:08:07 netberry sshd[4222]: Failed password for gitroot from 127.0.0.1 port 51970 ssh2
Jul 23 09:08:08 netberry sshd[4222]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=localhost.localdomai...r=gitroot
Jul 23 09:08:10 netberry sshd[4222]: Failed password for gitroot from 127.0.0.1 port 51970 ssh2
Jul 23 09:08:10 netberry sshd[4222]: Connection closed by 127.0.0.1 [preauth]
Run Code Online (Sandbox Code Playgroud)

该日志显示多次尝试通过 ssh 从主机本身(我刚刚ssh gitroot@localhost在控制台中输入)以 gitroot 身份登录。

rah*_*hmu 4

正如评论中提到的,您应该添加/usr/bin/git-shell/etc/shells.