CentOS – add user to sudoers

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:
Then type the command VI x! Force save and exit.
Note: this file is readonly, with no ! Save failed.
Exit the superuser: $ exit
Can just use sudo.

Leave a Reply

Your email address will not be published. Required fields are marked *