当g + w在用户的主目录上时,请允许ssh

当用户的主目录是g+w时,是否可以允许一个用户通过SSH进行连接?

据我了解,如果我在/etc/ssh/sshd_config设置了StrictModes no ,我可以允许这样做,但是这意味着每个其他用户都可以移动其他人的~/.ssh

有没有其他方法可以做到这一点?

以前的服务器用户的主目录设置为a+w ,但是公钥ssh仍然是可能的。 它的sshd_config也有StrictModes yes ,所以我怀疑一定有办法做到这一点。

目前,用户可以在主目录为700时通过公钥sshlogin,但是如果将其更改为任何其他可写组的值,则不能。

/etc/ssh/sshd_config设置StrictModes no是你正在寻找的。 从CentOS 6.7的手册页。 我希望你的版本是兼容的。

  StrictModes Specifies whether sshd(8) should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is “yes”.