How To Restart Sudoers Service In Rhel 7
How to use sudo or sudoers to start, stop & restart Apache on Linux Cloud Servers
sudo permits an immune user to execute a command equally the superuser or another user, every bit determined in the sudoers document. Setting the original and effective UID and GID to lucifer the target user specified in the passwd file and initializing the grouping vector based on the group file.
This is a groovy way to avoid security bug and information technology requires users to authenticate with passwords by default.
This article will guide you to the basic commands virtually using sudo or sudoers to starting time, cease & restart Apache on a common Linux OS.
CentOS / Fedora
-
Below are the normal commands to start, cease and restart the Apache with sudo.
# sudo /etc/init.d/httpd first # sudo /etc/init.d/httpd finish # sudo /etc/init.d/httpd restart -
The below error will get while trying to run the to a higher place-mentioned commands without editing the
sudoers file.**layerstack** is not in the sudoers file. This incident will exist reported.
Here layerstack is a standard user that using for giving permission to start/stop/restart Apache Web Server.
-
Now open
/etc/sudoersfile with whatsoever text editor and add together the below line.# vi /etc/sudoers
layerstack ALL = /etc/init.d/httpd
Note: Replace the username
layerstackwith your original username. -
Salvage the file by pressing,
:w! then Enter -
Now tin start, stop and restart the Apache with sudo by using the commands mentioned before and using the password of the user while proceeding with these.
Ubuntu / Debian
-
Below are the commands to beginning, terminate and restart the Apache with sudo.
# sudo /etc/init.d/apache2 showtime # sudo /etc/init.d/apache2 stop # sudo /etc/init.d/apache2 restart -
The below error volition become while trying to run the above-mentioned commands without editing the
sudoers file.**layerstack** is not in the sudoers file. This incident volition exist reported.
Hither layerstack is a standard user that using for giving permission to start/stop/restart Apache Web Server.
-
Now open up
/etc/sudoersfile with any text editor and add the below line.# vi /etc/sudoers
layerstack ALL = /etc/init.d/apache2
Note: Supercede the username
layerstackwith your original username. -
Save the file by pressing,
:w! and then Enter -
Now can first, stop and restart the Apache from the user with sudo by using the commands mentioned before and using the password of the user while proceeding with these.
Related Tutorials
-
Creating Sudo User on Linux Cloud Servers
-
How to save a file in Vim / Vi without Root Permission with sudo on Linux Cloud Servers
-
How to cheque Apache Error Logs on Linux Cloud Servers
How To Restart Sudoers Service In Rhel 7,
Source: https://www.layerstack.com/resources/tutorials/How-to-use-sudo-or-sudoers-to-start-stop-restart-Apache-on-Linux-Cloud-Servers
Posted by: santeevortunfir.blogspot.com

0 Response to "How To Restart Sudoers Service In Rhel 7"
Post a Comment