Home  >  Article  >  Operation and Maintenance  >  Steps: Add new user in Linux system

Steps: Add new user in Linux system

WBOY
WBOYOriginal
2024-02-26 13:45:061257browse

Steps: Add new user in Linux system

Linux user management: steps to add new users

In Linux systems, administrators can add new users through the command line so that Provide new users with system access. This article details the steps for adding a new user and provides specific code examples.

Step 1: Log in to the system with root privileges

First, you need to log in to the Linux system as the root user. The Root user has full access to the system and can perform all operations including user management.

Step 2: Create a new user

Use the following command to create a new user, where "newuser" is the user name you want to create. You can also replace it as needed:

sudo adduser newuser

You will be prompted to set the new user's password and other information. Follow the prompts to complete the new user setup.

Step 3: Assign group permissions to the new user

You can choose to add the new user to one or more user groups. For example, add the new user to the sudo group to give it administrator rights:

sudo usermod -aG sudo newuser

Step 4: Verify the new user’s access rights

You can switch to the new user identity and verify their access rights Whether the setting is correct:

su - newuser

After entering the new user's password, if the new user identity is successfully switched, it means that the new user has been successfully added to the system.

Conclusion

Through the above steps, you have successfully added a new user and assigned access rights to it. Please ensure that new users' permissions are set correctly to protect system security, and that user permissions are regularly reviewed and updated.

In Linux systems, user management is one of the basic skills that administrators must master. Through the operation guide in this article, I believe you can easily add new users and reasonably manage user permissions in the system. I wish you success in Linux user management!

The above is the detailed content of Steps: Add new user in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn