切换到root,然后执行下面的命令
[root@localhost thrfur]# useradd thrfurcom //添加thrfurcom用户
[root@localhost thrfur]# passwd thrfurcom //给用户thrfurcom添加密码
[root@localhost thrfur]# chmod -v u+w /etc/sudoers //授权sudoers文件可写权限
[root@localhost thrfur]# vim /etc/sudoers //编辑sudoers文件
添加如下内容:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
thrfur ALL=(ALL) ALL
thrfurcom ALL=(ALL) ALL <--添加这一行
[root@localhost thrfur]# chmod -v u-w /etc/sudoers //取消授权sudoers文件可写权限
切换用户,以thrfurcom身份登录,可以使用 ‘sudo su’ 命令切换到ROOT