Adding users to centos 7 Learning

Source: Internet
Author: User

Before centos is used, Ubuntu is used. Therefore, the two commands useradd and adduser are ambiguous. on Ubuntu, these two commands are used, while on centos, the same command is used, adduser is a link.

# Ll/usr/sbin/| grep userlrwxrwxrwx. 1 Root 7 October 30 17:09 adduser-> useradd-rwxr-x ---. 1 Root 114064 June 10 09:16 useradd
1. Add a user. centos does not have any interaction actions! After creating a user, you must change the password. Otherwise, you cannot log in.
# Useradd Dev # create a user # passwd Dev # change the password to change the user's Dev password. New Password: re-enter the new password passwd: All authentication tokens have been successfully updated.

2. Add the sudo permission for the new user. Otherwise, it is not appropriate to ask the root boss about everything. You know!

1) Add writable permissions to the sudoers file

# Keep the permission mode of chmod-v U + w/etc/sudoers "/etc/sudoers as 0640 (RW-r -----)
2) Add new user information to # allow root to run any commands anywher In the sudoers file.
# Allow root to run any commands anywherroot all = (all) alldev all = (all) All # Add User Information

3) cancel the sudoers file write permission

# chmod -v u-w /etc/sudoersmode of "/etc/sudoers" changed from 0640 (rw-r-----) to 0440 (r--r-----)


Adding users to centos 7 Learning

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.