I was trying to save times to type password for sudo
because one of my scripts had to be randomly repeated quite often. I googled some information about how to bypass typing password and applied to my server. Now the sudo account is corrupted and all the users on server cant not use sudo
. How can I fix this?
What I did:
I created
mysudoers
in/etc/sudoers.d/
sudo vim /etc/sudoers.d/mysudoers
Added my account in
mysudoers
rna ALL = NOPASSWD: ~/scripts/getLog
save & exit
chmod
sudo chmod 0440 /etc/sudoers.d/mysudoers
Error log when I type sudo
:
rna@rna-P580:/etc/sudoers.d$ sudo
sudo: >>> /etc/sudoers.d/mysudoers: syntax error near line 0 <<<
sudo: parse error in /etc/sudoers.d/mysudoers near line 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
~
with the path of your home directory (which would be something like/home/rna
). – muru Jul 25 '14 at 07:39pkexec
. thanks for the link @muru – RNA Jul 25 '14 at 08:29