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 create a new login account using Linux's root account

2025-04-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces how Linux uses the root account to create a new login account, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

How to create a new user under Linux usually, for the sake of security, it is common to create an ordinary user for yourself instead of directly using the root user, because the authority is large, misoperation will easily lead to irreparable losses. On Linux systems, only root users have permission to create other users.

The creation process is as follows:

Useradd-d / home/newuser newuser

This method sets the home directory and user name of the user

But this is not enough, you have to explicitly set the password for the user (even the second method is no exception, because when you use Love as the password to log in to the system, you still cannot log in), and the command is passwd username

[root@lwww ~] # passwd Hudamin

Changing password for user Hudamin.

New UNIX password:

BAD PASSWORD: it is too short

Retype new UNIX password:

Passwd: all authentication tokens updated successfully.

If you log in to the system at this time, you will be prompted that the user's home directory has not been created, so there is still a lack of a step, that is, to create a home directory for the corresponding user, which belongs to the user. It should be noted that since the home directory of the new user is first created by root, the Linux system requires that the owner of the home directory must be the user himself. Therefore, after using root to create the home directory, You also need to replace the owner with the new user itself. The command is as follows:

Mkdir-p / home/newuser

Chown newuser:newuser / home/newuser

Got it! Now you can log in using newuser.

Thank you for reading this article carefully. I hope the article "how Linux uses root account to create a new login account" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and follow 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

Servers

Wechat

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

12
Report