Centos tutorial 2: add an operator account

Source: Internet
Author: 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.

 

1. Create an amonest account:

 
[Root @ localhost ~] # Useradd amonest

 

2. Set the amonest password:

 
[Root @ localhost ~] #PasswdAmonestchanging PasswordForUser amonest. New Password: # enter the password. retype new password: # enter the password again.Passwd: All authentication tokens updated successfully.

 

3. Add the amonest account to the wheel group.

 
[Root @ localhost ~] # Usermod-G wheel amonest

 

4. ConfigurationOnly the user in the wheel group can run the "Su-" command to log on as the root user. Users in other groups can run the "Su-" command and enter the correct root password, you cannot log on as the root user. OpenIn the/etc/PAM. d/su file, locate the following line, remove the comment and save it:

 
# Auth required pam_wheel.so use_uid

Then run the following command:

 
[Root @ localhost ~] #Echo "Su_wheel_only Yes">/Etc/Login. Defs

 

OK. Now you can log out of root and use amonest to log on. Run the "Su-" command when the root permission is required.

 

Reference connection: http://www.cnblogs.com/eastson/archive/2012/07/01/2572187.html

Related Article

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.