更改 sftp chrootDirectory 的密码会阻止其登录

更改 sftp chrootDirectory 的密码会阻止其登录

因此,我在 sshd_config 中将 chrootdir 设置到一个文件夹,并且用户为 myuser,它已经正常工作了几个月,然后今天我想更改 myuser 的密码,因此我使用 passwd 执行了此操作,然后重新启动/etc/init.d/ssh restart,但是现在当我尝试使用更新后的密码通过 sftp 登录时失败。

设置sshd_config

Subsystem sftp internal-sftp

Match User myuser
   ChrootDirectory /chrootDIR
   ForceCommand internal-sftp
   AllowTcpForwarding no
   PermitTunnel no
   X11Forwarding no

登录信息/var/log/auth.log如下:

 sshd[13368]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=[client ip is here]  user=myuser
 sshd[13368]: Failed password for myuser from [client ip is here] port 39154 ssh2
 sshd[13368]: Connection closed by [client ip is here] [preauth]

我认为我没有遗漏任何步骤,是吗?

答案1

好的,所以似乎问题与有关AllowUserssshd_config因为当我将其注释掉并重新启动 ssh 时它就可以正常工作,然后我将它添加回文件底部,重新启动并且它就可以正常工作,然后我将其底部的注释掉并取消注释原始行,然后重新启动 ssh 并且它仍然有效。

所以总而言之,我不太确定它是什么,也许 ssh 没有正确重启。

相关内容