add user to sudoers group code example
Example 1: add user to sudoers
echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username
Example 2: show users in sudo group
grep -Po '^sudo.+:\K.*$' /etc/group
echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username
grep -Po '^sudo.+:\K.*$' /etc/group