New user, password change, etc. under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.