After installing your system, CentOS default regular users are unable to use the sudo command, then we need to join the logged in user in the/etc/sudoers file
Assume that the user name is Tom
Switch to super user: $ Su–
Open/etc/sudoers file: $/sudoers
Modify the file contents:
Find the root ALL= (ALL) ALL line
Insert a new row below, as follows:
tom ALL=(ALL) ALL
Then type the command VI “x!“ Force save and exit.
Note: this file is read–only, with no “!“ Save failed.
Exit the superuser: $ exit
Can just use sudo.