Friday , April 26 2024

Create User in Linux

In today’s article I will tell you about Create User in Linux.

While working on Linux, we need different users for logging or for different operations.

For this, we may need to perform operations such as creating a user,

changing the user’s password, but to do this, it must be done with the root user.

Creating a User

We use useradd and adduser commands to create users.

We can use the following command to add users with Adduser.

We can use the following command to add users with useradd.

While using the above commands,

we can set a password with the -p parameter, or we can create the home directory with the -G parameter, which group it will be included in, and the -m parameter.

More than one parameter like this can be used.

We can see the relevant parameters of useradd or adduser commands by typing –help.

Setting User Password

You have created a user, but if you want to set the password or change the current user’s password,

you can use the command below.

When you run the password command with the user you are connected to, it will change the password of the user you are connected to.

To change the password of a different user,

the password can be changed by typing the relevant user at the end of the password command as follows.

Example usage is as follows.

You can use the command below to list users.

Loading

About Faruk Erdem

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories