In general, if you want to edit sudo, you suppose to use visudo. But what if i am doing a script build? Can you just copy and replace a sudo configuration file directly? or use sed within the sudo config file? Basically, is there a way to automate the configuration of sudo?
All visudo does is some locking and syntax checking. If you are sure about your file, go ahead and replace the while thing at will. Same with running sed on it - just be sure its right, and everything is fine.
Here, we actually create our sudo file from an NIS map.
Yes you can script the creation of /etc/sudoers or even just plain overwrite it without impacting anything. However, if it is messed up you may allow more access or no access depending on its contents.
Edward L. Haletky
VMware Communities User Moderator
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education. As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization