我希望能够让一组用户使用公钥身份验证进行身份验证,而其他用户使用密码身份验证。
这在 Linux 上的 OpenSSH 中可能吗?如果是这样,我该怎么做?
看完之后/etc/ssh/sshd_config,似乎我仅限于启用密钥身份验证或使用 PAM。
kub*_*zyk 15
该Match指令(在 中描述man sshd_config)允许在 sshd 服务器的一个实例中为不同的用户指定不同的身份验证方法。作为枚举单个用户和组的奖励,它还允许通过通配符选择它们。
Match Group wheel # for users from group wheel:
PubkeyAuthentication
Match Group !wheel,* # for other users:
PasswordAuthentication
# caution: don't add directives here - they will be caught by "Match" block
# (end of file /etc/ssh/sshd_config)
Run Code Online (Sandbox Code Playgroud)
小智 0
可以运行两个不同的 OpenSSH 实例。一个将配置为PasswordAuthentication,另一个配置为PubkeyAuthentication(每个绑定到不同的地址)。然后AllowGroups配置指令将用于控制哪些组可以使用哪个服务器。
但我可能误解了这个问题,因为你说“它是 PAM 或 PublicKey 身份验证”。两者可以同时启用。它们并不相互排斥。