Added general users and wheel group users to centos

Source: Internet
Author: User

Centos adds general users and users in the wheel group 2009-12-1612: 56 [1] system logon and exit
Samplelogin: root users use the root user to log on to the system and enter the root user name.
Password: keystore enter the root Password set during installation.

[Root @ sample ~] # Successfully logged on as the root user. The prompt is "#". If a user logs on successfully, the prompt is "$"

[Root @ sample ~] # Exit logging out of the system



[2] General User Creation and Deletion
[Root @ sample ~] # Useraddcentospub general user who creates a centospub user
[Root @ sample ~] # Passwdcentospub secret set a password for centospub
Changingpasswordforusercentospub.
NewUNIXpassword: enter the password (the password will not be displayed)
RetypenewUNIXpassword: Login enter the password again to confirm the two passwords are consistent
Passwd: allauthenticationtokensupdatedsuccessfully. login password set successfully

[Root @ sample ~] # Userdel-rcentospub Delete



[3] using a common user to log on as a root user

Because the root user has full operation permissions on the system, in order to avoid some mistakes, we recommend that you log on to the system as a general user. If necessary, you need root operation permissions, then, run the "su-" command to log on as the root user.
Centospub @ sample ~] The $ login prompt is "$", indicating that the current status is normal user centospub login IN THE SYSTEM

[Centospub @ sample ~] $ Su-login: Enter the command used to log on as the root user.
Password: Login enter the root Password (the Password will not be displayed), press ENTER

[Root @ sample ~] # Login Successful Login as root user, prompt changed to "#"

[Root @ sample ~] # Exit logging back to normal user logon status

[Centospub @ sample ~] The $ login prompt is changed to "$" and returns to the status of the general user centospub logging on to the system.



[4] creating common users in the Administrator Group

Generally, you can log on as the root user to configure the system as Administrator by executing the "su-" command and entering the correct root password. However, in order to further enhance the security of the system, it is necessary to establish an Administrator group that only allows users in this group to execute the "su-" command to log on as the root user, users in other groups cannot Log On As root even if they execute "su-" and enter the correct root password. In UNIX, the group name is usually "wheel ".


Root @ sample ~] # Usermod-Gwheelcentospub Users Add the general user centospub to the Administrator Group's wheel group

[Root @ sample ~] # Vi/etc/pam. d/su Hei open this configuration file

# Authrequiredpam_wheel.souse_uid locate the row and remove "#"
Bytes
Authrequiredpam_wheel.souse_uid success is changed to this State (about 6th rows)

[Root @ sample ~] # Echo "SU_WHEEL_ONLYyes">/etc/login. defs statement: add the statement to the end of the row.



After completing the preceding operations, you can create a new user. Then, you can use the new user to test the user. If the user is not added to the wheel group, run the "su-" command, even if you enter the correct root password, you cannot log on as the root user.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.