[miaojiang@localhost ~]$ sudo ls /root
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for miaojiang:
miaojiang is not in the sudoers file. This incident will be reported.
[miaojiang@localhost ~]$ visudo
visudo: /etc/sudoers: Permission denied
[root@localhost ~]# visudo
You have new mail in /var/spool/mail/root
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
miaojiang ALL=(ALL) ALL
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
## Allows people in group wheel to run all commands
[root@localhost ~]#
[miaojiang@localhost ~]$ sudo ls /root
[sudo] password for miaojiang:
anaconda-ks.cfg 测试sudo命令