How to enable sudo password?
I just installed Ubuntu 12.04 on a virtual machine in the Windows Azure Cluster.
By default sudo
is not requiring a password.
I would like to force a password on all sudo
commands.
How do I go about making this change?
Here is the content of the visudo
:
#
# 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 secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults timestamp_timeout=0
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) 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
I was confused at first. Later I found the configuration in /etc/sudoers.d/90-cloud-init-users
.
# Created by cloud-init v. 0.7.5 on Tue, 16 Sep 2014 14:34:31 +0000
# User rules for azureuser
azureuser ALL=(ALL) NOPASSWD:ALL
Comment the last line will solve your problem.