When you log in to the Linux operating system with a normal user, sometimes you will need to operate the system directory or file, switch to root mode is more troublesome, at this time can be achieved through the sudo command to temporarily get Super Administrator privileges. To run the sudo command directly, you will be prompted like this: Xxxis not in the sudoers file. This incident would be reported. Here, XXX is the user name and then causes the sudo command to be unable to execute, at this time, the following resolves:
- Enter Super User mode. That is, enter "Su-", the system will let you enter the super user password, enter the password and enter the Super User mode. (Of course, you can also use root directly)
- Edit the/etc/sudoers file. That is, enter the command "vim/etc/sudoers", enter the edit mode, find this line: "root all= (All)all" under it add "xxx all= (All)all" ( Here's xxx is your username) and then save the exit.
- Then it's all right.
Add sudo permissions to the user under Linux