Linux: Add a user to have sudo privileges

If there is no sudo group on your system, add one.

$ sudo groupadd sudo

If the sudoers file is not configured to allow the sudo group sudo access, add this.

$ visudo
# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

Save the file. Next, add your user to the sudo group.

$ usermod -aG sudo userName

Updated:

Comments