I tried to follow these steps
How to to run sudo command without a password:
- Backup your /etc/sudoers file by typing the following command:
sudo cp /etc/sudoers /root/sudoers.bak
- Edit the /etc/sudoers file by typing the visudo command:
- Append/edit the line as follows in the /etc/sudoers file for user named ‘vivek’ to run ‘/bin/kill’ and ‘systemctl’ commands:
vivek ALL = NOPASSWD: /bin/systemctl restart httpd.service, /bin/kill
- Save and exit the file.
I am receiving the following error
/etc/sudoers: syntax error near line 30 <<<
sudo: parse error in /etc/sudoers near line 30
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
How to fix this? I am trying to reedit but I couldn’t.Please help on this.