[Build Linux @ ~] $ su - root
Password:
[root @ Linux ~] # vi / etc / sudoers
add the following in the root Build ALL = (ALL) ALL, Build my user name, put it into your user name.
The Allow the root to the any RUN ## Commands Anywhere
the root ALL = (ALL) ALL
the Build ALL = (ALL) ALL
Esc then enter the command mode, then: wq!
Note: remember is: wq not:! Wq, because the / etc / sudoers file is read-only, plus mandatory modifications saved!.
Reproduced in: https: //www.cnblogs.com/yuanping/archive/2012/12/23/2829663.html