一、问题描述:刚装好的CentOs7 64位系统,运行 (sudo) yum install sz 后显示
wang is not in the sudoers file . this incident will be reported
you need to be root to perform this command
这个时候试过了 ” su - “ 也是显示wang is not in the sudoers file . this incident will be reported
1、直接输入 " su " 后可以进入一个如下的root伪权限中,
2、然后添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3、编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。如下,就可以了。
在新装的CentOs7 64位系统中,使用`sudo yum install sz`命令时遇到权限问题,提示用户未在sudoers文件中。通过输入`su`进入root伪权限,然后修改`/etc/sudoers`文件,添加用户权限,从而解决无法切换到root用户的问题。
1021

被折叠的 条评论
为什么被折叠?



