How to run normal user root user command without sudo in linux


#1

Hi Team,

I have one local user call raj. I have added that user in the sudoers file like below.

raj ALL=(ALL) NOPASSWD:ALL

Now i am trying to restart the httpd service as raj. I am giving the command below as raj user.

service httpd restart ====> Error

but when i tried like as

sudo service httpd restart -====> working

I need to use the command as service httpd restart not like sudo service httpd restart.

How can i give permission to local user(raj) to run command without sudo.


#2

type sudo before start service

eg. sudo service httpd start


#3

sudo is needed for normal user

otherwise you must change id of user to zero

  1. vim /etc/passwd
    2)change uid of user to zero

but:

i don’t recommend above solution.