Playing with mdo(1)

A bit overkill, but this works as a sudo-ish replacement.

Assuming (as root):

sh:
root@host: $ id
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)

... then set this rule where xxxx is your ordinary user's ID.

sh:
root@host: $ sysctl security.mac.do.rules='id=xxxx>id=0,gid=0,+gid=0,gid=5,+gid=5'

Then as the ordinary user ...

sh:
ordinary@host: $ mdo -u root whoami
root

Apparently, 'root' is the default so you can omit the '-u' clause for a shorter syntax.

sh:
ordinary@host: $ mdo whoami
root
 
Back
Top