001、
使用root用户编辑配置文件:vim /etc/sudoers
在root ALL=(ALL) ALL行下面增加如下内容(其中liujiaxin02是普通用户名):
liujiaxin02 ALL=(ALL) ALL
修改完成后,保存退出。
002、测试
[liujiaxin02@PC1 ~]$ whoami liujiaxin02 [liujiaxin02@PC1 ~]$ yum install httpd Loaded plugins: fastestmirror, langpacks You need to be root to perform this command. [liujiaxin02@PC1 ~]$ sudo yum install httpd ## 普通用户使用yum [sudo] password for liujiaxin02: Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 8.3 kB 00:00:00 * base: mirrors.bupt.edu.cn * epel: mirrors.bfsu.edu.cn
标签:00,PC1,管理员,linux,yum,liujiaxin02,普通用户,root From: https://www.cnblogs.com/liujiaxin2018/p/17105772.html