标准帐户能够在没有密码请求的情况下使用sudo获得root访问权限

我使用该命令使用安装程序安装了特定软件

sudo ./install.sh

安装完成后,我的ubuntu笔记本电脑上的所有帐户都可以通过简单地发出命令sudo -s ,甚至是标准(非管理员)帐户来获得root访问权限。 发出命令sudo -s时也没有密码提示。

 Defaults env_reset 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 # 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 ALL ALL=(ALL) NOPASSWD:ALL 

如果您查看sudoers文件的最底部,它会显示“ALL ALL =(ALL)NOPASSWD:ALL”。 这是无密码执行sudo的语法。 备份文件,然后删除该行。

安德鲁

删除此行:

 ALL ALL=(ALL) NOPASSWD:ALL 

但是出现这真的很奇怪,所以你安装的软件(基本上是我猜的脚本)可能是恶意的。 你可能想要开始第二个问题,在那里粘贴那个脚本的内容,并征求意见……这太吓人了!