add user to sudoers linux code example
Example 1: add user to sudoers
usermod -aG sudo username
Example 2: add sudo user ubuntu
# add a user and set a password
adduser USERNAME
# add user to sudoers / sudo groupe with command below
usermod -aG sudo USERNAME
Example 3: add user with sudoer centos
username ALL=(ALL) NOPASSWD:/usr/bin/du,/usr/bin/ping