I am new to Linux/CentOS and kind of learning by doing.
I searched the man pages and the How Tos and only found a partial solution to my problem:
I'm running a minimalized CentOS 5 on a VPS.
I created a user. Let's call him user1.
User1 is member of the group wheel.
I changed the sudoers file, so that members of the group wheel can execute all the root commands without password.
%wheel ALL=(ALL) NOPASSWD: ALL
User1 is supposed to gain complete root rights with the su or sudo command now.
But this is what happens:
[user1@rs ~]$ sudo service sshd restart
sudo: service: command not found
and entering the root password to have root rights
leads to the same result:
[root@rs user1]# service sshd restart
bash: service: command not found
I found out that by typing
user1 can become root and then executing the desired commands is no problem, but frankly that is not what I want.
I'd like to understand what I'm doing wrong and learn how to give user1 the right to execute root commands through sudo or su.
I used the search option with the term "sudo" and then "problems with sudo" and still had 1.000.000 results. I am also looking for the answer for hours now, so please forgive me if this question already exists and maybe link me to the right thread.
Thank you in advance,