Other posts in this series:

Fairly straightforward:

useradd -m -g wheel -s /bin/bash chendry

The -m ensures that a home directory gets created and initialized with the skeleton files. The -g wheel adds the user to the wheel group which we’ll use to give the user sudo access.

Enabling Sudo

The very last line in /etc/sudoers does something interesting which makes our job easier for scripting / automation:

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

This means that we can enable sudo for all users in the wheel group using the following:

echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/00_wheel