Visudo Gives no Error but asks "What Now?"

10,506

There is an error in the file you just edited, this is why visudo is complaining. From http://www.courtesan.com/sudo/man/1.7.10/visudo.man.html:

visudo parses the sudoers file after the edit and will not save the changes if there is a syntax error. Upon finding an error, visudo will print a message stating the line number(s) where the error occurred and the user will receive the “What now?” prompt. At this point the user may enter ‘e’ to re-edit the sudoers file, ‘x’ to exit without saving the changes, or ‘Q’ to quit and save changes. The ‘Q’ option should be used with extreme care because if visudo believes there to be a parse error, so will sudo and no one will be able to sudo again until the error is fixed. If ‘e’ is typed to edit the sudoers file after a parse error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature).

About your error, isn't the "python" command missing the complete path? I mean:

matt    ALL=(root) NOPASSWD: /usr/bin/python /home/matt/token-abe/setup.py install --force
Share:
10,506

Related videos on Youtube

Matthew Mitchell
Author by

Matthew Mitchell

Updated on September 18, 2022

Comments

  • Matthew Mitchell
    Matthew Mitchell almost 2 years

    I'm trying to add a new sudoers file using sudo visudo -f /etc/sudoers.d/abe . I added the contents:

    # Allow automatic update of abe
    matt    ALL=(root) NOPASSWD: python /home/matt/token-abe/setup.py install --force
    

    But when I try to write and quit, I get "What Now?" with no error:

    $ sudo visudo -f /etc/sudoers.d/abe
    [sudo] password for matt: 
    What now? e
    What now? 
    

    I'm using Debian 7.

  • Matthew Mitchell
    Matthew Mitchell almost 10 years
    Indeed, thankyou, it needed the full path. Though shouldn't visudo give an error message explaining the error?
  • Antony Hatchkins
    Antony Hatchkins over 8 years
    debian gave me error ">>> /etc/sudoers: syntax error near line 32 <<<" in this exact situation