第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > Linux用户获得超级管理员权限

Linux用户获得超级管理员权限

时间:2024-08-15 21:33:55

相关推荐

Linux用户获得超级管理员权限

问题描述

在创建了新的虚拟机和用户后,用户可能还没有超级管理员的操作权限:

[peng@localhost network-scripts]$ sudo su[sudo] password for peng: peng is not in the sudoers file. This incident will be reported.

解决方法:

使用su切换到root用户,会需要root的密码:

[peng@localhost network-scripts]$ su Password: [root@localhost network-scripts]#

然后编辑sudoers文件nano /etc/sudoers,找到下面的一行:

## Allow root to run any commands anywhereroot ALL=(ALL) ALL

增加新的用户名即可,我这里新用户为peng,后面ALL=(ALL) ALL照写

## Allow root to run any commands anywhereroot ALL=(ALL) ALLpeng ALL=(ALL) ALL

保存退出

一些用户相关常用的操作

adduser [用户名] : 新增用户 passwd [用户名] : 修改用户密码 userdel -r [用户名]: 删除用户

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。