【发布时间】:2016-12-03 05:33:28
【问题描述】:
在配置文件 /etc/ssh/sshd_config 中,我想确定一些特定用户(或组)的 PasswordAuthentication 条目,例如:
Match Group xyz_admin, xyz_support
PasswordAuthentication no
Match User yvonne,yvette
PasswordAuthentication yes
我不想干预或控制类似但不相关的条目,这些条目可能存在也可能不存在,例如:
Match User xavier
X11Forwarding yes
Match Group alice
AllowTcpForwarding yes
以下 Augeas 表达式会创建我需要的条目,但可能会损坏现有的配置条目。
set /files/etc/ssh/sshd_config/Match[1]/Condition/Group "xyz_admin,xyz_support"
set /files/etc/ssh/sshd_config/Match[1]/Settings/PasswordAuthentication "no"
set /files/etc/ssh/sshd_config/Match[2]/Condition/User "yvonne,yvette"
set /files/etc/ssh/sshd_config/Match[2]/Settings/PasswordAuthentication "yes"
知道如何使这些表达式更具体,以免与任何现有且不相关的“匹配”条目混淆吗?
【问题讨论】: