<div dir="ltr"><div>Hi everybody,</div><div><br></div><div>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 ...</div>
<div><br></div><div>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.</div><div><br></div><div>I've tried something like this:</div>
<div><br></div><div>augtool> print /files/etc/ssh/sshd_config/AllowGroups/</div><div>/files/etc/ssh/sshd_config/AllowGroups</div><div>/files/etc/ssh/sshd_config/AllowGroups/1 = "root"</div><div><br></div><div>
augtool> print /files/etc/ssh/sshd_config/AllowGroups/*[last()]</div><div>/files/etc/ssh/sshd_config/AllowGroups/1 = "root"</div><div><br></div><div>So as far as I understand, AllowGroups is mapped to an array with only one entry.</div>
<div><br></div><div>augtool> set /files/etc/ssh/sshd_config/AllowGroups/*[last()+1] testgroup</div><div>error: Failed to execute command</div><div>Setting /files/etc/ssh/sshd_config/AllowGroups/*[last()+1] failed</div>
<div><br></div><div>... 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.</div><div><br></div>
<div><br></div><div>I was reading documentation about "How to append a node to the tree" here: <a href="https://github.com/hercules-team/augeas/wiki/Adding-nodes-to-the-tree">https://github.com/hercules-team/augeas/wiki/Adding-nodes-to-the-tree</a> and it says "The predicate [last()+1] forces set to create a new node."</div>
<div><br></div><div>I'm stuck there and I don't have a lot of other ideas on how to do this simple thing.</div><div><br></div><div>Any help would be very appreciated :-)</div><div><br></div><div>Thanks</div><div><br>
</div><div>Cheers</div><div><br></div><div>Rémi</div></div>