View the list of users
CAT/ETC/PASSWD can view a list of all users
W can view the list of currently active users
Cat/etc/group Viewing user groups
New user
1. Add a new user account using the Useradd command with the following syntax:
Code:
Useradd option User Name
Each of these options has the following meanings:
Code:
-C Comment Specifies an annotative description.
The-D directory specifies the home directory, and if this directory does not exist, the-m option can be used to create the master directory.
The-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's user number, and if you have the-o option, you can reuse the other user's identification number.
USERNAME Specifies the login name of the new account.
Example 1:
Code:
# useradd–d/usr/sam-m Sam
This command creates a user Sam,
Where the-D and-m options are used to generate a home directory for the login Sam/usr/sam (/usr is the parent directory where the default user home directory resides).
Example 2:
Code:
# useradd-s/bin/sh-g group–g adm,root Gem
This command creates a new user gem, which is the login shell of/bin/sh, which belongs to the group user groups, and also to the ADM and root user groups, where group user groups are their primary groups.
Change Password
If you change root's own password, enter passwd directly.
Enter two times, the new password can be.
If you modify another user's password, add the user name after passwd
New user, password change, etc. under Linux