Howto: Linux creating user account under group

https://‮tual.www‬turi.com
Howto: Linux creating user account under group

To create a user account on a Linux system and add it to a specific group, you can use the useradd command.

For example, to create a user account named user1 and add it to the group1 group, you can use the following command:

sudo useradd -g group1 user1

This will create a new user account user1 and add it to the group1 group.

Alternatively, you can use the adduser command to create a user account and add it to a group. For example, to create a user account named user1 and add it to the group1 group, you can use the following command:

sudo adduser --ingroup group1 user1

This will create a new user account user1 and add it to the group1 group.

After creating the user account, you can set a password for the account using the passwd command. For example, to set the password for the user1 account, you can use the following command:

sudo passwd user1

This will prompt you to enter and confirm the password for the user1 account.

Note: You can use the groups command to view the groups that a user belongs to. For example, to view the groups that the user1 user belongs to, you can use the following command:

groups user1
Created Time:2017-10-29 22:08:47  Author:lautturi