CentOS普通用户添加sudo权限

1. 进入超级用户模式

    su root

2. 添加sudoers文件写权限.

    chmod u+w /etc/sudoers

3.添加username到sudoers文件里(参考"root ALL=(ALL) ALL"来添加)

    vim /etc/sudoers

    root      ALL=(ALL)   ALL

    username  ALL=(ALL)   ALL

4.撤消sudoers写权限. 记得撤消写权限.

    chmod u-w /etc/sudoers

原文地址:https://www.cnblogs.com/liqipeng/p/4584804.html