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