Take a simple requires-root option, such as:
[Leo@chessman ~]$ cat /etc/shadow
cat: /etc/shadow: Permission denied
[Leo@chessman ~]$ su
[root@chessman Leo]# cat /etc/shadow
<contents here will not show you my passwords>
and it works as root.
But when I try to execute this command: sudo cat /etc/shadow, it doesn't work. This is what happens:
[Leo@chessman ~]$ sudo cat /etc/shadow
[sudo] password for Leo:
Leo is not in the sudoers file. This incident will be reported.
The only problem is, usually when I type sudo something, I expect that something to be run as root. For some reason, it isn't, it is trying to run it as Leo, but I was already logged in as Leo.
Can somebody help me fix this problem?