User and User Group Management
Linux is a multi-user multi-task operating system. In a system, multiple users may be working at the same time. There are three main types of users in Linux:
- Root User: A super user with the highest permissions and can manage other users
- Virtual user: A virtual user is a user logging on to the/sbin/nologin shell. Such users cannot log on to the system. Such as ftp and apache users
- Common User: These users can log on to the system and operate the contents of their home directories.
A user group is a set of users with the same features. In Linux, file permissions can be set by group
View user information
- Use the id command to view user information
Uid: the user id, which is generally unique.
Gid: the id of the user group, which is generally unique.
Groups: User Group
- Use the finger command to view user information
Centos6.4 is not installed by default. Run yum-y install finger to install it.
- View the/etc/passwd file
The password file is specified in the/etc/shadow file. The formats of these two files are described below
Add User
Use useradd or adduser (only a connection pointing to useradd)
Only root and root users in the same group have the execution Permission. Other users do not have the Permission to add users (the Permission denied error will be reported)
Next we will add 5 Users
To be continued...