Management of Linux system squadron user accounts refers to adding, modifying, and deleting user accounts. Because there may be multiple users in a Linux system, the management of user accounts is also very common. This article will share the tutorial on adding, modifying, and deleting user accounts for Linux systems.
add user accounts is to create a new account in the system, and then assign users to a new account number, user group, home directory and login Shell and other resources. The account you just added is locked and cannot be used.
Adding a new user account
Using the useradd command, the syntax is as follows:
useradd option username
The options are as follows:
-c comment Specifies an annotative description.
-d directory Specifies the user's home directory. If this directory does not exist, the home directory can be created with the -m option.
-g User Group Specifies the user group to which the user belongs.
-G User Group, User Group Specifies the additional group to which the user belongs.
-s Shell File Specifies the user's login shell.
-u User Number Specifies the user number of the user. If there is also the -o option, the identification number of other users can be reused.
Username Specify the login name of the new account.
For example:
# useradd –d /usr/sam -m sam
This command creates a user sam with the -d and -m options for The login name sam generates a home directory /usr/sam (/usr is the parent directory where the default user home directory is located).
# useradd -s /bin/sh -g group –G adm,root gem
This command creates a new user gem, the user's login shell is /bin/sh, it It belongs to the group user group and belongs to the adm and root user groups. The group user group is its primary group.
Adding a user account means adding a record to the new user in the /etc/passwd file and updating other system files such as /etc/shadow, /etc/group, etc. The contents of these documents will be described in detail later.
Linux provides an integrated system management tool, userconf, which can be used to manage user accounts in a unified manner.
If a user's account is no longer used, it can be removed from the system. To delete a user account is to delete the user record in the system file such as /etc/passwd, and delete the user's home directory if necessary. Delete an existing user account using the userdel command, the format is as follows:
userdel option Username
The commonly used option is -r, which is used to delete the user's home directory.
For example:
# userdel sam
This command deletes the user sam in the system file (mainly /etc/passwd, /etc/shadow, /etc/group, etc. ) the record while deleting the user's home directory.
Modifying the user account is to change the user's related properties, such as user number, home directory, user group, login shell, etc. according to the actual situation.
Modify the information of existing users using the usermod command, the format is as follows:
usermod option User name Previous12Next page Total 2 pages
KVM is a virtual machine, mainly used in Linux systems. How do you install KVM on a
Linux system, using traditional methods to install Fedora is a waste of time, but also takes up spac
Because AWX does not support Debian system, Debian users feel very headache, in fact, as long as a s
Generally speaking, the number of subfolders and files in the system is very large, we cant count th
What if the Linux partition read-only causes the database to stop writing data?
How Linux changes the MAC address in the virtual machine
How does the Linux system send mail?
How to solve the Linux account expiration?
Linux how to install and configure Cgroup
Ubuntu can't connect to Windows Phone solution
Steps to install KVM virtual machine in CentOS5.5
How Linux system analyzes Cache in memory
What are the common commands for Linux rookie?
What should I do if the Win10 system does not pop up when I plug it into the headset?
What are the characteristics of Internet TV?
Tips for using the camera on the Linux operating system
No need for third-party software to manually build Windows 8 Start Menu
Win8 boot prompt "System resources are not enough to complete the api" how to solve?
Linux system (Debian and Ubuntu) completely remove wine
The win7 system forced shutdown after the black screen does not respond to the three solutions.
Is the blade server really not suitable for SMEs?
Win7 Ultimate activation process needs to pay attention to what details