Linux: Troubleshoot the reason why ordinary users sudo -i need to enter a password

Situation description: After
I ffcslog in to the system with an account, I sudo -ineed to enter a password, and some do not need to enter a password.
However, after checking /etc/sudoers, I found that the ffcs account configured in it is nopasscorrect.
insert image description here

Troubleshooting process:
1. visudoCheck the configuration, NOPASSWD
insert image description here
2. Check the user group situation . Compared with the user group configured
id ffcs
insert image description here
for the same ffcsaccount , it is found that there is an additional user groupNOPASSWD
insert image description here
wheel

3. Check visudothe configuration again, and check wheelthe configuration of the user group
insert image description here
. It is found that wheelthe user group needs to enter a password. 并且,ffcs的配置在wheel用户组的配置上面 所以,底下wheel的生效。
So, when this ffcsis used sudo -i, a password is required.

Solution:
Delete the user group ffcsin wheel, so that sudo -ino password is required.
gpasswd -d ffcs wheel

Guess you like

Origin blog.csdn.net/Brave_heart4pzj/article/details/130762954