Currently, when I want to grant some group of users access to edit a file, I proceed as follows:
ipa sudocmd-add --desc=Vi IMproved default-mode, no-exec, no-suspend mode' '/usr/bin/rvim'
ipa sudocmdgroup-add edition --desc='commands for restricted edition'
ipa sudocmdgroup-add-member edition --sudocmds=/usr/bin/rvim
ipa sudorule-add edition-4-operators --desc='Operator access to restricted edition commands'
ipa sudorule-add-allow-command edition-4-operators --sudocmdgroups=edition
and then the rest of the options related to HBAC, SELinux, etc.
I want to replace /usr/bin/rvim
with the builtin sudoedit(8)
in all sudorules of my freeIPA server.
Do I need to declare sudoedit
as a sudocmd
as usual? Can I directly add sudoedit
to the sudocmdgroup
without declaring it as a sudocmd
previously?
This is the way to do it (actually, a practical example):
Being sudoedit a sudo builtin
trying to add the sudorule using
/usr/bin/sudoedit
will fail with this error:Works correctly for both
sudo -e
andsudoedit
.