What is the syntax for using NOPASSWD and sudoedit at the same time in /etc/sudoers? I tried this:john ALL=(ALL) NOPASSWD: sudoedit /path/to/filebut I still get prompted for a password.
sudoers - How to use NOPASSWD and sudoedit at the same time?
sudoedit
sudoers fileYou should be able to do any of these.Such as this:john ALL=(ALL) NOPASSWD: sudoeditor this:john ALL=(ALL) NOPASSWD: sudoedit /path/to/fileLastly you could do it like this too:Cmnd_Alias SOMECMD = sudoedit /path/to/filejohn ALL=(ALL) NOPASSWD: SOMECMDOnce you have one of these definitions in place you invoke it like so:sudoedit /path/to/fileDetailsYou don't need to invoke it with a sudo command prefix like this:sudo sudoedit /pat/to/fileIt takes care of the sudo automatically. It's equivalent to sudo -e /pat/to/file which will invoke an editor with elevated privileges.excerpt from the sudo/sudoedit man page-e          The -e (edit) option indicates that, instead of running a command,             the user wishes to edit one or more files. In lieu of a command, the             string sudoedit is used when consulting the sudoers file.  If the             user is authorized by sudoers the following steps are taken:               1.  Temporary copies are made of the files to be edited with the                    owner set to the invoking user.               2.  The editor specified by the SUDO_EDITOR, VISUAL or EDITOR                    environment variables is run to edit the temporary files.                     If none of SUDO_EDITOR, VISUAL or EDITOR are set, the first                    program listed in the editor sudoers variable is used.               3.  If they have been modified, the temporary files are copied                    back to their original location and the temporary versions                    are removed.You can override the editor by setting one of the environment variables mentioned above with the name of an editor to use such as vim or gedit, for example.