To add the user to the group run the command below as root or another sudo user. Make sure you change “username” with the name of the user that you want to grant permissions to.
usermod -aG sudo username
Granting sudo access using this method is sufficient for most use cases.
To ensure that the user has sudo privileges, run the whoami command: