Solution to sudo password error


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

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

Some predecessors suggested using visudo instead of vim editor