在Redhat下,一般用户执行sudo命令时,系统会报出”isnot in the sudoers file. This incident will bereported”这样的错误。原因是Redhat在建立用户时并没有把用户自动加入到sudo用户列表中。
whereis sudoers
sudoers: /etc/sudoers /usr/share/man/man5/sudoers.5.gz
su - root
chmod u+w /etc/sudoers
vi /etc/sudoers
rootALL=(ALL) ALL
yourname ALL=(ALL) ALL
chmod u-w /etc/sudoers