1.run command:
$su
and input password of root.
2.edit /etc/sudoers, input command:
$vi /etc/sudoers
find a line:"root ALL=(ALL) ALL"
follow that and add a new line:
"test ALL=(ALL) ALL"
Note: This 'test' is a user name that you want to let it have root permission.
3.exit the edit mode, input
:wq!
Note: this file is readonly, so you have to add '!'
4.exit root mode, then you can use 'sudo' for 'test' user.