codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🐧

Linux & Bash

15 / 60 topics
14Process Management15User Management16Group Management
Tutorials/Linux & Bash/User Management
🐧Linux & Bash

User Management

Updated 2026-05-15
10 min read

User Management

Introduction

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.

Concept

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.

Key Commands

  • 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.

Examples

Creating a New User

To create a new user, use the useradd command followed by the username. For example, to create a user named "john":

Terminal
  • -m: Creates the user's home directory if it doesn't exist.
  • -s /bin/bash: Sets the user's default shell to Bash.

Setting a Password

After creating a user, you need to set a password for them:

Terminal
  • -d /home/new_home_directory: Changes the user's home directory.

To change the user's shell:

Terminal

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:

Terminal

Each line in this file represents a user account with various fields separated by colons. The first field is the username.

What's Next?

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

Always ensure you have backups before making significant changes to user accounts.

PreviousProcess ManagementNext Group Management

Recommended Gear

Process ManagementGroup Management