How do I edit /etc/sudoers from a script?

Old thread, but what about:

echo 'foobar ALL=(ALL:ALL) ALL' | sudo EDITOR='tee -a' visudo

Leave a Comment