The /etc/sudoers file gives users the ability to run commands that are typically reserved for administrators. The commands require a password or no password, depending on how you set them up in the sudoers file. The sudoers file can’t be edited using any text editor. You have to use visudo.

<pre lang="bash">
$ visudo

Add groups to access sudo.

<pre lang="bash">
# Allow users in techgroup to run all commands
%techgroup   ALL=(ALL)   NOPASSWD: ALL
# Allow users in techgroup without a password
%techgroup   ALL=(ALL)   NOPASSWD: ALL
# Allow users in techgroup to shutdown the system
%techgroup   localhost=/sbin/shutdown -h now
#includedir /etc/sudoers.d

Typically you have to add your groups in the sudoers file. Notice the last line. Sudoers will include config files found under the /etc/sudoers.d directory. In certain circumstances, there are others pieces of software such as compliance software CFEngine that writes over changes in the sudoers file. If this is the case, then you have to add your groups in a file inside the /etc/sudoers.d directory.