3

I want to add a new user to run all commands without a password, so I went to edit /etc/sudoers (using visudo of course) by adding the line myuser ALL=NOPASSWD: ALL.

Everything is OK, but 15 minutes later, the file sudoers was reset to original. It means the sudoers file didn't have anything that I had typed in it previously.

Ex: the first sudoers:

root ALL=(ALL) ALL  
%wheel ALL=(ALL) NOPASSWD: ALL  
ALL ALL=NOPASSWD: ALL 

After adding line:

root ALL=(ALL) ALL  
%wheel ALL=(ALL) NOPASSWD: ALL  
ALL ALL=NOPASSWD: ALL  
myuser ALL=NOPASSWD: ALL 

But 15 minutes later:

root ALL=(ALL) ALL  
%wheel ALL=(ALL) NOPASSWD: ALL  
ALL ALL=NOPASSWD: ALL

So why does it have to be reset after 15 minutes and how to fix it?

karel
  • 110,292
  • 102
  • 269
  • 299
tan ho
  • 31
  • 2
  • The command is supposed to be `username ALL=(ALL) NOPASSWD: ALL` Try adding this to the sudoers file instead – Rumesh Apr 27 '15 at 12:39
  • Are you saving, closing _and exiting_ `visudo` or are you leaving it open? – terdon Apr 27 '15 at 12:52
  • i have added line: "username ALL=(ALL) NOPASSWD: ALL" or anything, (after edit the sudoers file, i type :wq to save it) file sudoers was still reset after 15 minutes. – tan ho Apr 27 '15 at 13:13

0 Answers0