Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the useradd command in Linux

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use the useradd command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

The Linux common command useradd command is used for new system users created in Linux. Useradd can be used to set up user accounts. After the account is set up, use passwd to set the password of the account. You can use userdel to delete the account. The account created by using the useradd instruction is actually saved in the / etc/passwd text file

New system users created by useradd

It is added that in Slackware, the adduser instruction is a script program, which uses the way of conversation to obtain the input user account information, and then passes it to the useradd command that really establishes the account to establish a new user, which makes it convenient for the administrator to set up the user account. In Red Hat Linux, the adduser command is the symbolic link of the useradd command, and the two are actually the same instruction.

Syntax useradd (option) (parameter) option-c: add the comment text. The remarks are saved in the passwd remarks field;-d: specify the starting directory when the user logs in;-D: change the default value;-e: specify the validity period of the account;-f: specify the number of days after the password expires to close the account;-g: specify the group to which the user belongs;-G: specify the additional group to which the user belongs;-m: automatically create the login directory for the user. -M: do not automatically establish the login directory of the user;-n: cancel the establishment of the group with the user name;-r: establish the system account;-s: specify the shell;-u used by the user after login: specify the user id. Parameter user name: the user name to be created.

The user created by the instance joins the group:

Useradd-g sales jack-G company,employees / /-g: join the primary group,-G: join the secondary group to create a new user account, and set up ID:

Useradd caojh-u 544 need to note that the ID value should be greater than 500 as far as possible to avoid conflicts. 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.

Thank you for reading this article carefully. I hope the article "how to use useradd commands in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report