Solution to sudo password error

Time:2020-2-13

Situation: when the non root user uses sudo command, the password error is always reported. Add configuration in / etc / sudoers to solve this problem
However, / etc / sudoers only has write permission for root user. Before operating the file, add write permission first

su
chmod u+w /etc/sudoers
vim /etc/sudoers

Write in file

username ALL=(ALL)  ALL

Then WQ saves and exits

chmod u-w /etc/sudoers
exit

Some predecessors suggested using visudo instead of vim editor