To create a user named prowlarr and a group named prowlarr, and then assign the user to the group in Kali Linux, you can follow these steps. These commands are executed in the terminal with root privileges or using sudo.
Step 1: Create the Group
First, create the group prowlarr using the groupadd command:
bash
sudo groupadd prowlarr
This command creates a new group named prowlarr.
Step 2: Create the User
Next, create the user prowlarr and assign it to the prowlarr group using the useradd command:
bash
sudo useradd -m -s /bin/bash -g prowlarr prowlarr
Here’s what each option does:
-m: Creates the user's home directory (e.g., /home/prowlarr).
-s /bin/bash: Sets the default shell for the user to /bin/bash.
-g prowlarr: Assigns the user to the prowlarr group as its primary group.
Step 3: Set a Password for the User (Optional)
If you want to set a password for the prowlarr user, use the passwd command:
bash
sudo passwd prowlarr
You will be prompted to enter and confirm the password.
Step 4: Verify the User and Group
To verify that the user and group were created successfully, you can use the following commands:
Check the user details:
bash
id prowlarr
This will display the user ID (uid), group ID (gid), and any additional groups the user belongs to.
Check the group membership:
bash
groups prowlarr
This will list all groups the prowlarr user is a member of.
Step 5: Add the User to Additional Groups (Optional)
If you need to add the prowlarr user to additional groups (e.g., sudo or docker), you can use the usermod command:
bash
sudo usermod -aG <group_name> prowlarr
For example, to add the user to the sudo group:
bash
sudo usermod -aG sudo prowlarr
After running this command, verify the group membership again with:
bash
groups prowlarr
Step 6: Test the User Account (Optional)
To test the user account, you can switch to the prowlarr user using the su command:
bash
su - prowlarr
This will log you in as the prowlarr user. You can check the current user and group with:
bash
whoami
groups
Summary
By following these steps, you have successfully:
Created a group named prowlarr.
Created a user named prowlarr and assigned it to the prowlarr group.
Optionally added the user to additional groups and tested the account.
If you encounter any issues or need further clarification, feel free to ask!