执行cat /etc/sudoers | grep -E "^[^#]*Defaults[[:space:]]+targetpw"命令检查是否存在“Defaults targetpw”或“Defaults rootpw”配置项。如果不存在,请在“/etc/sudoers”文件的“#Defaults specification”下添加“Defaults targetpw”或者“Defaults rootpw”配置项。
执行cat /etc/sudoers命令检查“/etc/sudoers”文件中是否存在“root ALL=(ALL:ALL) ALL”和“root ALL=(ALL) ALL”之外的其他用户或组的“(ALL) ALL和(ALL:ALL) ALL”。如果存在,请根据实际业务场景确认是否需要,如果确认不需要,请删除,例如“user ALL=(ALL) ALL”、“%admin ALL=(ALL) ALL”或“%sudo ALL=(ALL:ALL) ALL”。