红帽RHCE考试上午-RHCSA(RH200)
servera.example.com 任务
14. 普通用户组提权
• 将 harry用户组提升成与管理员相同的权限,并且无密码执行特权命令。
实操演示过程:
[root@servera ~]# visudo
# %wheel ALL=(ALL) NOPASSWD: ALL
%harry ALL= NOPASSWD: ALL
命令解析:
%:表示对整个用户组生效掉
ALL=:表示指定的用户或用户组与什么用户具有相同的权限
NOPASSWD:表示无需要输入密码进行验证,也就是免密
验证:
查看/etc/shadow文件时是需要root用户的权限的,普通用户是无法有这个权限
[root@servera ~]# su - harry
Last login: Wed Aug 3 21:30:57 CST 2022 on pts/0
[harry@servera ~]$ sudo tail -1 /etc/shadow
注:这里普通用户查看时是需要提示输入密码才行
nfsnobody:!!:19206::::::
[root@servera ~]# su - natasha
Last login: Wed Aug 3 21:31:17 CST 2022 on pts/0
[natasha@servera ~]$ sudo tail -1 /etc/shadow
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for natasha:
注:如果不是harry用户组的,去查看/etc/shadow文件时就需要提示输入密码了
本文介绍红帽认证工程师(RHCE)考试中关于如何将harry用户组权限提升至管理员级别,并实现无密码执行特权命令的具体操作步骤。通过修改sudoers文件,实现了特定用户组成员无需密码即可执行管理员命令。
2421

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



