On 14.04 here. I SSHed into my machine, added the following line to /etc/sudoers
:
myuser ALL=NOPASSWD: ALL
And then tried running:
sudo mkdir /etc/blah
...and I'm being asked for my password. Why?!?
I do not want to be asked for my password when doing this operation. Please note that when I run ls -ltr /
I get:
drwxr-xr-x 94 root root 4096 Jul 30 13:28 etc
But I don't think this matters because I've set myself up as a "sudoer", right?
More importantly, what do I need to do so that I can run sudo mkdir /etc/blah
as my current user (myuser
) without being asked for the password?
Here's my entire /etc/sudoers
file:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
fizzbuzz ALL=NOPASSWD: ALL
chadmin ALL=NOPASSWD: ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
visudo
however any manual edits to this file were not copy-n-paste jobs, I typed everything in as-is. But doesvisudo
edit other files besides this one? That might be it.../etc/sudoers.d/
, they may be overriding things from/etc/sudoers