Ever since I update to 16.04 I notice whenever I use any sudo command the terminal does not ask me the password before executing the command,The command is directly executed.I am the admin and I have no other user accounts.
I have seen sudo does not ask for password and my /etc/sudoers is exactly like given in answer but still when using sudo command, terminal does not prompt a password instead execute the command.
I would like to know in detail how can /etc/sudoers
can be modified for
Making any particular user account(including admin) to be prompted or not prompted for password when using sudo command.
How to exclude any particular command to be excluded from prompting password when using sudo for any user account(including admin).
Here is my sudoers file
# /etc/sudoers
#
# 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,timestamp_timeout=0
# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification root ALL=(ALL) ALL
# Members of the admin group may gain root privileges %admin ALL=(ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
Output of sudo -l
Matching Defaults entries for bharat on ratcoder:
env_reset, timestamp_timeout=0
User bharat may run the following commands on ratcoder:
(ALL) NOPASSWD: ALL
sudo -l
./etc/sudoers.d
has the NOPASSWD rule. Find and delete itsudo grep NOPASSWD /etc/sudoers.d -R