Hi everybody,

Sorry for the noise if this is not the right place for beginners to ask for
help but I couldn't manage to find the "augeas" info or user list ...

I'm just starting to play with augeas and what I'm trying to do is fairly
simple: Add a groupname to the "AllowGroups" directive in
/etc/ssh/sshd_config.

I've tried something like this:

augtool> print /files/etc/ssh/sshd_config/AllowGroups/
/files/etc/ssh/sshd_config/AllowGroups
/files/etc/ssh/sshd_config/AllowGroups/1 = "root"

augtool> print /files/etc/ssh/sshd_config/AllowGroups/*[last()]
/files/etc/ssh/sshd_config/AllowGroups/1 = "root"

So as far as I understand, AllowGroups is mapped to an array with only one
entry.

augtool> set /files/etc/ssh/sshd_config/AllowGroups/*[last()+1] testgroup
error: Failed to execute command
Setting /files/etc/ssh/sshd_config/AllowGroups/*[last()+1] failed

... this fails. I translate it like "add the node *testgroup* after the
last element of the array AllowGroups" ... so I don't really understand
where is my mistake here.


I was reading documentation about "How to append a node to the tree" here:
https://github.com/hercules-team/augeas/wiki/Adding-nodes-to-the-tree and
it says "The predicate [last()+1] forces set to create a new node."

I'm stuck there and I don't have a lot of other ideas on how to do this
simple thing.

Any help would be very appreciated :-)

Thanks

Cheers

Rémi
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to