Create, modify, and delete user accounts.
Context: GNU/Linux command examples.
Create, modify, and delete user accounts.
Certainly! Here are examples of GNU/Linux commands for creating, modifying, and deleting user accounts:
Create a User Account:
Create a new user account:
sudo useradd usernameThis command creates a new user account with the specified username.
Create a user account with additional information (e.g., full name):
sudo useradd -c "Full Name" usernameThis command creates a user account with the specified username and full name.
Set User Account Password:
- Set a password for a user account:This command prompts you to enter and confirm the password for the specified username.
sudo passwd username
- Set a password for a user account:
Modify User Account:
Modify a user account's username:
sudo usermod -l new_username old_usernameThis command changes the username of the specified user account.
Modify a user account's home directory:
sudo usermod -d /new/home/directory usernameThis command changes the home directory of the specified user account.
Modify a user account's primary group:
sudo usermod -g new_group usernameThis command changes the primary group of the specified user account.
Delete User Account:
Delete a user account:
sudo userdel usernameThis command removes the specified user account.
Delete a user account and its home directory:
sudo userdel -r usernameThis command removes the specified user account along with its home directory.
Note: The above commands typically require root or sudo privileges to execute. Replace "username" with the actual username you want to create, modify, or delete.
These commands provide you with the basic functionality to create, modify, and delete user accounts in GNU/Linux. Depending on the distribution, there may be additional options and flags available for these commands.
