sudoers
-----
Managed & Fully Managed Linux Servers
sudo su -
su -
# cp /etc/sudoers /root/sudoers.bak
# chmod 600 /etc/sudoers
# vi /etc/sudoers
90 ## Allow root to run any commands anywhere
91 root ALL=(ALL) ALL
92 kamal ALL=(ALL) ALL ->[Add user-kamal]
:wq
Run sudo without password on CentOS Linux
Backup /etc/sudoers file, run:
sudo cp /etc/sudoers /root/sudoers.bak
Edit the /etc/sudoers file on CentOS:
sudo visudo
Run /usr/sbin/rebootcommand without password on CentOS:
kamal ALL = NOPASSWD: /usr/bin/reboot
Save and exit the file.
How to execute ALL sudo commands without password on CentOS
Type the following command as root user:
# visudo
Or
$ sudo visudo
Append the following entry to run ALL command without a password for a user named marlena:
kamal ALL=(ALL) NOPASSWD:ALL
----