In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to create users and groups in linux". Friends who are interested may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to create users and groups by linux.
There are three types of users under linux: 1. Superuser: root has all the permissions of operating system uid 0
2. Ordinary users: ordinary users have limited permissions of the operating system uid 500-6000
3. Pseudo users: in order to facilitate system management and meet the requirements of the corresponding system process file owners, they cannot log in to the system uid 1 Murray 499.
Manage the user's files and basic information here / etc/passwd any user has the right to read it, only define the account, not the password.
One line represents a user, divided into seven parts.
Account name: password: uid:gid: related information: user's home directory: interpreter
The user's password file / etc/shadow is readable only by root
User name: password: last modified time: maximum time interval: minimum time interval: warning time: inactivity time: failure time
0 can be modified at any time 999999 a week
Two simple ways to create an account
1 add a record to / etc/passwd
2 # ueradd user # passwd password (lee user's affiliated group is admin)
View the user's information:
Common options for the useradd command are as follows:
-d home-dir: specify the user's home directory.
-e date: the date on which the account is disabled in the format: YYYY-MM-DD.
-f days: the number of days before the account is disabled after the password expires.
-g group-name: the group name or GID of the primary group to which the user belongs.
-G group-list: a list of affiliated groups to which the user belongs. Multiple items are separated by commas.
-m: create a home directory if it does not exist.
-M: no user home directory is created.
-n: do not create private groups for users.
-r: create a system account with a UID less than 500 without a home directory.
-p: encrypted password.
-s: specifies that the user logs in to Shell. The default is / bin/bash.
-u UID: specifies the user's UID, which must be unique and greater than 499
Deletion of users:
User's disable:
User's unlock:
Modification of user login name:
(where there is a locked user, there is a locking password, which forbids the user from logging in to the system. This method is not only mentioned above, but will not be exemplified one by one.)
Profile / etc/group for the group
Group name group password group id other users
Creation and deletion of groups (deletion of groups is different from that of users)
Creation and deletion of group passwords
What if I really don't know? View help. Man or-- help
At this point, I believe you have a deeper understanding of "how to create users and groups in linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.