Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Linux User and Group Account Management

Tech May 19 2

User and Group Accounts Overview

Linux controls resource access through user identities. Accounts are categorized in to user accounts and group accounts.

User Account Roles

  • Superuser (root): UID 0 with full system privileges
  • Regular Users: UID 1000+ (CentOS7) with restricted permissions
  • System Users: UID 1-999 (CentOS7) for service operations without login capability

Group Account Types

  • Primary Group: Each user's default group (GID same as UID)
  • Supplementary Group: Additional groups for shared resource access

User Account Configuration Files

/etc/passwd

root:x:0:0:root:/root:/bin/bash
  • Format: username:password_placeholder:UID:GID:comment:home_directory:login_shell
  • Password stored in /etc/shadow

/etc/shadow

root:$6$TgG...:18983:0:99999:7:::
  • Fields: username, encrypted password, last password change, min/max password age, warning period, inactivity period, expiration date

Password Policy Management

chage -m 7 -M 90 -W 7 testuser
Option Description
-m Minimum days between password changes
-M Maximum password validity period
-W Warning days before expiration

Group Management Commands

Group Creation

groupadd -g 1001 developers

Member Management

gpasswd -a testuser developers

User Account Operations

User Creation

useradd -m -u 1001 -g users -G wheel -s /bin/bash testuser

Account Configuration Files

  • ~/.bash_profile: Executes at login
  • ~/.bashrc: Runs for interactive shells
  • ~/.bash_logout: Executes at logout

Account Modification

usermod -l newuser -d /home/newuser -s /bin/zsh testuser

File System Permissions

Permission Types

  • Read (r): View content/list directory
  • Write (w): Modify content/manage files
  • Execute (x): Run programs/traverse directories

Permission Modification

chmod u=rw,g=r,o= file.txt
chown testuser:developers project/

UMASK Defautls

umask 022  # Default directory:755, file:644

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.