Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to establish General users in CentOS system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

CentOS system how to establish a general user, I believe that many inexperienced people are helpless about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Due to the popularity of CentOS, there are many learners of CentOS now. Let's look at the problem of creating general users in the CentOS system administrator group.

Under normal circumstances, the average user can log in as root user to configure the system at the administrator level by executing the "su -" command and entering the correct root password. However, in order to further strengthen the security of the system, it is necessary to establish a group of administrators, only allowing users in this group to execute the "su -" command to log in as root user, so that users in other groups cannot log in as root user even if they execute "su -" and enter the correct root password. Under UNIX, the name of this group is usually "wheel."

[root@sample ~]# usermod -G wheel CentOSpub ← Add general user CentOSpub to admin group wheel group [root# vi /etc/pam.d/su ← Open this configuration file #auth required /lib/security/$ISA/pam_wheel.so use_uid ← Find this line and remove the "#" at the beginning of the line auth required /lib/security/$ISA/pam_wheel.so use_uid ← becomes this state (approximately at line 6) [root@sample ~]# echo "SU_WHEEL_ONLY yes" >> /etc/login.defs ← Add statement to end of line

After completion, you can create a new user in CentOS system, and then use this new user test to find that users who have not joined the wheel group, execute the "su -" command, even if you enter the correct root password, you cannot log in as root user.

After reading the above content, do you know how to establish a general user in CentOS? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report