Sudo ascendence without Password: - We cause got to perform twenty-four hours to twenty-four hours activities inwards our information technology infrastructure, Sometime nosotros postulate to run simply about ascendence inwards whatever application or within simply about script that may require sudo alongside the command.
Therefore, inwards this guide, I am going to explicate how to configure password less sudo. As per our requirement nosotros tin setup sudo for all the ascendence or nosotros tin exclusively specify simply about ascendence to run equally sudo without password.
Prerequisites-
Step 1- setup sudo access for all the commands.
Step 3- Allow a user to run specify command only.
Save together with larn out from the file.
Systemctl ascendence working successfully without entering password.
Sumber https://linuxhowtoguide.blogspot.com/
Therefore, inwards this guide, I am going to explicate how to configure password less sudo. As per our requirement nosotros tin setup sudo for all the ascendence or nosotros tin exclusively specify simply about ascendence to run equally sudo without password.
Prerequisites-
- One user alongside sudo access (amar)
- One normal user (sudotest)
Step 1- setup sudo access for all the commands.
- Login to Linux Machine user alongside sudo access.
- modify /etc/sudoers file together with grant permission to sudotest user.
- Open sudoers file
amar@U16: $ sudo vi /etc/sudoers
- Add next line
sudotest ALL=(ALL) NOPASSWD:ALL
- Save together with larn out From the file.
- Login to linux machine using sudotest user.
- To verify sudotest user's sudo access without entering password, let's endeavor to halt Apache2 service using ascendence below
sudo /etc/init.d/apache2 stop
- Apache2 Service has been stopped successfully using sudo without entering password.
Step 3- Allow a user to run specify command only.
- Some scheme administrator may required to grant permission to simply about user to execute few commands alongside sudo equally per the projection requirement. In such instance nosotros tin grant sudo access to exclusively specific commands.
- Let's cause got an example- H5N1 user postulate to reload apache2 service to apply modified changes but User is non fellow member of Sudo group.
Try to reload apache2 service without granting access:
sudo /etc/init.d/apache2 reload
here is output of the command:- Grant user raj permission to reload apache2 service.
- Open /etc/sudoers file - I am editing this file alongside user amar (have sudo access)
amar@U16: $ sudo vi /etc/sudoers
Append follow line-raj ALL=(ALL) NOPASSWD:/bin/systemctl
Save together with larn out from the file.Save together with larn out from the file.
- Let's verify past times reloading apache2 service.
sudo /etc/init.d/apache2 reload
Systemctl ascendence working successfully without entering password.
Tidak ada komentar:
Posting Komentar