Granting Normal User To ROOT By SUDO in Redhat

  • Share
  • CevherShare
  • Share

A root user of a system can’t do all things, sharing the root password to other for doing the work is not a good idea. Here is the SUDO setup, which makes a normal user acts like a root. SUDO allows a normal user to acts like the super user for limited tasks. Ex: Normal user can’t add a user, we can assign the task of adding the users to normal users.

Create a user –>> Vincent

Get a the relevant fiel for the command. SUDO setup doesn’t allow a normal user to add a user by useradd command, instead we have to use its executable directory

 

USERADD by Normal user

#which useradd

/usr/sbin/useradd

 

Then go to sudoers file for SUDO setup

#vim /etc/sudoers

%vincent ALL=/usr/sbin/useradd

 

After this sudo setup, useradd can be done only by /usr/sbin/useradd, but not using useradd

vincent@xxxx]$/usr/sbin/useradd  kumar

 

Allow permissions for some specified files

Give file path in the  /etc/sudoers files

%vincent ALL=/usr/sbin/, /etc/passwd, /etc/hosts

 

prasad

About prasad

Prasad K has written 111 post in this blog.