Linux : Add user to sudo

Linux : Add user to sudo

When using Ubuntu Linux, I can run root command with adding sudo before command parameter. But, when I use Centos, I can not run sudo command. I get This error when try to running sudo command :

This is because toto is not sudoers group. We must add group toto to sudoers file.

We can Add user to sudo with edit /etc/sudoers file. Login as root and open this file. Example, I want to add user sudo with group toto, so I can add this line :

Save this file and log off. So, try to use sudo command 🙂