banner



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

  1. 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                              
  2. 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.                              

    sudoapache1

    Here layerstack is a standard user that using for giving permission to start/stop/restart Apache Web Server.

  3. Now open /etc/sudoers file with whatsoever text editor and add together the below line.

                    # vi /etc/sudoers                              

    sudoapache2

                    layerstack  ALL = /etc/init.d/httpd                              

    sudoapache3

    Note: Replace the username layerstack with your original username.

  4. Salvage the file by pressing,

                    :w! then Enter                              
  5. 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.

    sudoapache4

Ubuntu / Debian

  1. 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                              
  2. 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.                              

    sudoapache5

    Hither layerstack is a standard user that using for giving permission to start/stop/restart Apache Web Server.

  3. Now open up /etc/sudoers file with any text editor and add the below line.

                    # vi /etc/sudoers                              

    sudoapache6

                    layerstack ALL = /etc/init.d/apache2                              

    sudoapache7

    Note: Supercede the username layerstack with your original username.

  4. Save the file by pressing,

                    :w! and then Enter                              
  5. 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.

    sudoapache8

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

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel