我想检测用户正在使用什么类型的 ssh 公钥,并在
sshd_config
中对其执行匹配语句。我在 https://man.openbsd.org/sshd_config#Match 中看到了 Match 属性
PubkeyAcceptedAlgorithms
。但当我使用它时:
Match PubkeyAcceptedAlgorithms [email protected],[email protected]
当我尝试重新启动 sshd 时出现此错误:
Apr 10 12:59:42 ssh sshd[67517]: Unsupported Match attribute PubkeyAcceptedAlgorithms
Apr 10 12:59:42 ssh sshd[67517]: /etc/ssh/sshd_config line 136: Bad Match condition
你有办法做我想做的事吗?谢谢!
根据手册的Match指令:
可用的条件为 User、Group、Host、LocalAddress、LocalPort、RDomain 和 Address
这是第一个条件的标准,然后您可以使用
PubkeyAcceptedAlgorithms
。块中列出的所有条件之间存在逻辑 AND
:
Match User root
PasswordAuthentication no
PubkeyAcceptedAlgorithms [email protected],[email protected]