centos7为用户添加root权限
1. useradd sha passwd sha 创建用户及密码 2. 一、gpasswd -a sha wheel 赋予 sha root权限 二、 vi /etc/sudoers Allow root to run any commands anywhere root ALL=(ALL) ALL #原有行 sha ALL=(ALL) ALL #添加此行 保存后 登陆sha用户 使用 sudo 即可 三、vi /etc/sudoers ## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL #找到此行 如果前面有 # 删掉#后保存 执行 usermod -g root sha 登陆sha 使用sudo


