【发布时间】:2017-09-28 21:40:18
【问题描述】:
这是我在一个新的 ubuntu ec2 机器上的 sudoers 文件。为什么sudo su 不需要密码?
#
# 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:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) PASSWD:ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) PASSWD:ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) PASSWD:ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
有什么延迟吗?您是否想“获取”它或类似于您对 bashrc 文件所做的事情?为什么让sudo su 要求输入密码这么难?
编辑: 每个this 链接,正在运行:
sudo passwd ubuntu
sudo perl -pi -e 's/^(ubuntu.*)NOPASSWD:(.*)/$1$2/' /etc/sudoers
不起作用,甚至不会更改 sudoers 文件。
【问题讨论】:
标签: amazon-ec2 passwords sudo