系统教程
您现在的位置是:首页>服务器系统>Linux系统内容

Linux用户获得超级管理员权限:peng is not in the sudoers file

时间:2018-05-11 出处:未知复制分享人气(次) 【

问题描述:
在创建了新的虚拟机和用户后,用户可能还没有超级管理员的操作权限:
[peng@localhost network-scripts]$ sudo su
[sudo] password for peng: 
peng is not in the sudoers file.  This incident will be reported.
 
解决方法:
1.使用su切换到root用户,会需要root的密码:
[peng@localhost network-scripts]$ su 
Password: 
[root@localhost network-scripts]# 
2.然后编辑sudoers文件nano /etc/sudoers,找到下面的一行:
## Allow root to run any commands anywhere
root    ALL=(ALL)   ALL
3.增加新的用户名即可,我这里新用户为peng,后面ALL=(ALL) ALL照写
## Allow root to run any commands anywhere
root    ALL=(ALL)   ALL
peng    ALL=(ALL)   ALL
4.保存退出
 
附:
一些用户相关常用的操作
adduser [用户名] : 新增用户
passwd [用户名] : 修改用户密码
userdel -r [用户名]: 删除用户
 
    最新资讯
    热门内容
    小米移动电源能为iPad mini充几次电