sudo su– user

[root@localhost ~] # visudo –f /etc/sudoers

在文件中的root账户下添加需要切换root账户的账户

root ALL=(ALL)     ALL
user  ALL=(ALL)  ALL
原文地址:https://www.cnblogs.com/HarveyBing/p/5948307.html