Centos 7 Add Users

Source: Internet
Author: User

Before using CentOS more is Ubuntu, so in Useradd and adduser two command ambiguity, on Ubuntu system This is two commands, and on Centos is the same command, AddUser is the form of links exist

# ll/usr/sbin/| grep user  lrwxrwxrwx. 1 root root           7 October 17:09 adduser-useradd  -rwxr-x---. 1 root root      114064 June 
   10 09:16 Useradd  

  

1, add users, Centos does not have any interactive action! After the user is created, the password must be changed or not logged in

# Useradd Dev #创建用户  # passwd Dev #修改密码  change the password for user dev.  New Password:  re-enter the new password:  

  

2, add sudo permission for the new user, otherwise everything should consult Root boss is not suitable, you know!

1) Add writable permissions to the sudoers file

# chmod-v u+w/etc/sudoers  "/etc/sudoers" permission mode reserved for 0640 (rw-r-----)  

  

2) Add new user information in sudoers file to # allow root to run any commands Anywher, the modified effect is

# allow ROOT to run any commands anywher  root    all= (All)       all  dev     all= (all) all       #新增用户信息  

  

3) Cancel sudoers file writable permission

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

  

Centos 7 Add Users

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.