首先,创建一个新账号(注意,用户名必须全部小写):
useradd -m test111
passwd test111
之后在root账号下修改sudoers
ll /etc/sudoers
chmod 777 /etc/sudoers
在
root ALL=(ALL) ALL
下添加
test111 ALL=(ALL) ALL
如果需要免密试用yum命令,添加
test111 ALL=(ALL) NOPASSWD:ALL
之后登录test111测试yum命令:
sudo yum install xxxxx
测试成功!
参考:
https://blog.csdn.net/qq_27610647/article/details/100055786
https://blog.csdn.net/anqixiang/article/details/105220403
https://blog.csdn.net/ZGL_cyy/article/details/121092936
https://blog.csdn.net/xiguyang/article/details/122597080
https://www.51dongshi.com/ebedfrrevbdh.html
https://blog.csdn.net/weixin_69538701/article/details/124758239
https://www.cnblogs.com/ah-firelove/p/14304179.html
https://blog.csdn.net/m0_67393827/article/details/123828649
https://blog.csdn.net/modi000/article/details/125977972