In the config file /etc/ssh/sshd_config I want to determine PasswordAuthentication entries for a few specific users (or Groups) like:
Match Group xyz_admin, xyz_support
PasswordAuthentication no
Match User yvonne,yvette
PasswordAuthentication yes
I don't want to interfere with or have any control over similar but unrelated entries which may or may not be present like:
Match User xavier
X11Forwarding yes
Match Group alice
AllowTcpForwarding yes
The following Augeas expressions create the entries I need but could corrupt existing configuration entries.
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"
Any idea how I can make these expressions more specific so they avoid messing with any existing and unrelated "Match" entries ?