In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Today, what the editor shares with you is the detailed explanation of the use of the useradd command in linux. I believe many people do not know much about it. In order to make you better understand the detailed explanation of the use of the useradd command in linux, I have summarized the following contents for you. Let's look down together. I'm sure you'll get something.
Detailed explanation of useradd command
1. Action
The useradd command is used to set up a user account and create a starting directory for the user, with the permission of the root user.
Recommended: Linux video tutorial
two。 Format
Useradd [- d home] [- s shell] [- c comment] [- m [- k template]] [- f inactive] [- e expire] [- p passwd] [- r] name
3. Main parameters
-c: add the comment text, which is saved in the remarks column of passwd.
-d: specify the starting directory when the user logs in.
-D: change the default value.
-e: specifies the validity period of the account, which is permanent by default.
-f: specify how many days after the password expires to close the account.
-g: specify the starting group to which the user belongs.
-G: specifies the additional group to which the user belongs.
-m: automatically establish the login directory of the user.
-M: do not automatically create a user's login directory.
-n: cancels the establishment of a group with the user name.
-r: set up a system account.
-s: specifies the shell to be used by the user after logging in.
-u: specify the user ID number.
4. Description
Useradd can be used to set up a user account, which is the same as the adduser command. After the account is set up, use passwd to set the password of the account. The account created with the useradd command is actually saved in the / etc/passwd text file.
5. Application example
Set up a new user account and set up ID:
# useradd david-u 544
It should be noted that the ID value should be greater than 500 as far as possible to avoid conflict. Because some special users will be established after Linux installation, values between 0 and 499 are generally reserved for system accounts such as bin and mail.
# useradd oracle-g oinstall-G dba
Create a new oracle user, which initially belongs to the oinstall group, and also makes him belong to the dba group.
# useradd tomcat-d / var/servlet/service-s / sbin/nologin
Cannot use shell, and its user directory is to / var/servlet/service
This is the end of the detailed explanation of the use of the useradd command in linux. I hope the above content can be of certain reference value to everyone and can be put into practice. If you like this article, you might as well share it for more people to see.
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.