In the realm of Linux system administration, managing user accounts is a fundamental task. This tutorial will guide you through creating new users, modifying existing ones, and removing unwanted accounts. Understanding these processes is crucial for maintaining a secure and efficient environment.
Linux systems use a user account management system to control access to resources. Each user has a unique username and a user ID (UID). Additionally, each user belongs to one or more groups, which are used to manage permissions collectively.
useradd: Used to create new user accounts.usermod: Used to modify existing user accounts.userdel: Used to delete user accounts.passwd: Used to set or change user passwords.To create a new user, use the useradd command followed by the username. For example, to create a user named "john":
-m: Creates the user's home directory if it doesn't exist.-s /bin/bash: Sets the user's default shell to Bash.After creating a user, you need to set a password for them:
-d /home/new_home_directory: Changes the user's home directory.To change the user's shell:
This command removes the user account but does not remove the user's home directory or mail spool. To also remove these files, use the -r option:
Each line in this file represents a user account with various fields separated by colons. The first field is the username.
After mastering user management, the next step is to learn about group management. Groups are essential for organizing users and managing permissions collectively. Stay tuned for more tutorials on Linux system administration!
Info