Operating environment: Ubuntu Server 14.04, there is only one user root on the system
1. adduser command to add a new user
#adduser username
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/4D/wKiom1WX2ZWCpkATAAKCHPM_CkQ188.jpg "title=" Qq20150704141441.png "alt=" Wkiom1wx2zwcpkataakchpm_ckq188.jpg "/>
Note the difference between the AddUser and the Useradd command, Useradd is a binary executable tool in the Linux system, and AddUser is a script that can be executed after the useradd is encapsulated. So AddUser is more powerful and intelligent than Useradd, adduser to create user home directories and other related work while creating users.
2. Assigning new User Administrator privileges
Simply adding users to the sudo user group gives them administrator privileges.
#groups username//View the group to which the user belongs #usermod-g groupname username//Change the group to which the user belongs #usermod-g groupname username//Add user to New group #id username//view uid, GID for user
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/4B/wKioL1WX3VDTIgzgAAGU8oBcA-s879.jpg "title=" Qq20150704141947.png "alt=" Wkiol1wx3vdtigzgaagu8obca-s879.jpg "/>
3.deluser command to delete a user
The Deluser command without any parameters simply removes the user from the system, but all information and files related to that user, such as the home directory, are retained. To remove the user from the system cleanly and thoroughly, you need to join the--remove-all-files option.
#deluser--remove-all-files username//delete users and their related files and information #groupdel groupname//delete user Group Group
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/4D/wKiom1WX29Tzb9T3AAC9z85dHl8944.jpg "title=" Qq20150704142147.png "alt=" Wkiom1wx29tzb9t3aac9z85dhl8944.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/4D/wKiom1WX3AiiflF_AAKrlTnroCc818.jpg "title=" Qq20150704142411.png "alt=" Wkiom1wx3aiiflf_aakrltnrocc818.jpg "/>
4. Consistent creation of new users and actions to upgrade to administrators
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/4B/wKioL1WX3gjiVKMfAAK7-Nvne6k634.jpg "title=" Qq20150704142520.png "alt=" Wkiol1wx3gjivkmfaak7-nvne6k634.jpg "/>
Reference link: Linux Add/Remove users and user groups
Appendix:
User's permission profile is set in the/etc/sudoers file
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/4B/wKioL1WX34HAFcELAAIS_Gu3q-M333.jpg "title=" Qq20150704212013.png "alt=" wkiol1wx34hafcelaais_gu3q-m333.jpg "/>root Permissions configuration options
# User Privilege Specificationroot all= (all:all) all
sudo group permission settings
# Allow members of the group sudo to execute any command%sudo all= (all:all) all
It is visible that the sudo group user has the same permissions as root, with a% name representing the user group, with no% as a single user name, so in order to give a user administrator permission you can also add a line with the following configuration information directly:
Username All= (All:all) all
Reference Link: sudoers configuration file
This article is from "Whispering Autumn Wind" blog, please be sure to keep this source http://xjhznick.blog.51cto.com/3608584/1670964
Add delete new user in Linux/ubuntu