用root帐号登录或者su到root。
增加sudoers文件的写权限: chmod u+w /etc/sudoers
chmod u+w /etc/sudoers
vim /etc/sudoers 找到 root ALL=(ALL) ALL 在这行下边添加 username ALL=(ALL) ALL (username代表是你要添加sudo权限的用户名)
vim /etc/sudoers
root ALL=(ALL) ALL
username ALL=(ALL) ALL
除去sudoers文件的写权限: chmod u-w /etc/sudoers