Switching root login under liunx7 su prompts to deny permission

Insert picture description here
Insert picture description here
Example

[root@titan ~]# id apple
uid=1001(apple) gid=1001(fruit) 组=1001(fruit),10(wheel)
[root@titan ~]# id banana
uid=1002(banana) gid=1001(fruit) 组=1001(fruit)
[apple@titan ~]$ su - root
密码:

1
2
[root @ titan ~] #
[banana @ titan ~] $ su
--root secret:

1
2
su: Permission denied
[banana@titan ~]$

Ordinary users will be prohibited from su to root. If you want to assign ordinary users to su to root, you can execute the following command to add the user to the wheel group:

1
usermod -G wheel username

Guess you like

Origin blog.csdn.net/weixin_43214644/article/details/115249955