Users and Groups in Operating Systems
What are Users?
Users are entities allowed to perform actions on processes and files in an operating system. Modern desktop operating systems are multiuser, meaning multiple users can execute programs simultaneously.User Capabilities
When a user logs in, the system provides an environment with access to:File Operations
- Read files
- Modify content
- Change ownership
- Delete files
Process Execution
- Launch applications
- Access configurations
- Use hardware resources
- All within permission bounds
Multi-user Environment
Modern systems support multiple concurrent login sessions:- Console logins (tty1-6 in Linux)
- Graphical sessions (tty7 in Linux)
- Remote connections (SSH, RDP)
What are Groups?
Groups are collections of users that can be assigned permissions collectively. Why use groups?This is much more efficient than assigning permissions to individual users.
Windows Users and Groups
Built-in Users
| User | Description |
|---|---|
| Administrator | Full system access, created during installation |
| Guest | Limited access for temporary users |
| DefaultUser0 | Template for new user profiles |
Built-in Groups
| Group | Description |
|---|---|
| Administrators | Complete and unrestricted access to computer/domain |
| Users | Can run most applications but cannot make system changes |
| Power Users | Compatibility group with limited admin rights |
| Remote Desktop Users | Can log in remotely |
| Backup Operators | Can override security for backup/restore operations |
| Guests | Same access as Users, but more restricted |
| Network Configuration Operators | Can manage network features |
| IIS_IUSRS | Used by Internet Information Services |
| Hyper-V Administrators | Full access to Hyper-V features |
| Event Log Readers | Can read event logs |
| Performance Monitor Users | Can access performance counter data |
Access Control in Windows
How Access Control Works
ACE Types
For Files:- Read (r): View file contents
- Write (w): Modify files
- Execute (x): Run programs
- Print documents
- Manage printers
- Manage documents
ACL Evaluation Order
The system checks ACEs in descending order:- Check each ACE sequentially
- First allow or deny match returns immediately
- If no match found at end, deny access
NTFS Permissions
NTFS (NT File System) supports detailed permissions: Standard Permissions:- Full Control
- Modify
- Read & Execute
- Read
- Write
- Groups
- Users
- Computer accounts (in domains)
- Domain users and groups
- Local users and groups
Permission Inheritance
Objects inherit permissions from parent containers:- Owner: Creator of object (can always change permissions)
- Child objects: Automatically inherit parent permissions (if enabled)
- Benefit: Easier administration and consistent security
User Rights
User rights differ from permissions:| Aspect | Permissions | User Rights |
|---|---|---|
| Apply to | Objects (files, printers) | User accounts |
| Examples | Read, Write, Execute | Log on locally, Backup files |
| Location | Object properties | Security Policy → User Rights Assignment |
Best Practice: Assign user rights to groups rather than individual users.
Linux Users and Groups
User Management
Linux is a multiuser system that uses different users for secure management of applications and services.User Login Requirements
- Login name (username)
- Password
Don’t confuse login name with full name. Login is typically lowercase, no spaces.
The root User
The root user (UID 0) is the superuser:- Full system access
- Can create/delete users
- Unrestricted file system access
- Can modify any system setting
- root account is disabled by default
- Use
sudofor administrative tasks - Adds security layer (must know specific user account)
- root account enabled
- Direct root login disabled via SSH
- Must log in as regular user first
User Information Storage
| File | Contents |
|---|---|
/etc/passwd | User account information |
/etc/shadow | Encrypted passwords and password policies |
/etc/group | Group information and memberships |
User Directories
- Regular users:
/home/username - root user:
/root
Group Management
Groups allow assigning privileges to multiple users:- Primary group: Created automatically with same name as user
- Secondary groups: Users can belong to multiple groups
- Group ID (gid): Numeric identifier
- User ID (uid): Numeric identifier (root is always 0)
Check User ID and Groups
User Administration Commands
Creating Users
adduser is preferred as it creates home directory, sets up shell, and provides interactive prompts.Setting Passwords
Modifying Users
Deleting Users
Group Management
User Information Commands
Switching Users
File Permissions
Linux Permission System
Owner and Group
Every file has:- User owner: Creator of the file
- Group owner: Primary group of creator
- Owner: violin
- Group: cuerda
Permission Types
Read Permission (r)
For files:- View file contents
- Open with applications
- List directory contents
- See files and subdirectories
Write Permission (w)
For files:- Modify file contents
- Delete file
- Change permissions (chmod)
- Change ownership (chown)
- Create files and subdirectories
- Delete files and subdirectories
Execute Permission (x)
For files:- Run as program/script
- Enter directory (cd)
- Access files within (if you know names)
Permission Targets
Permissions can be granted to:- User owner (u)
- Group owner (g)
- Others (o) - all other users
You cannot assign permissions to specific users or groups beyond owner/group owner. To grant access to specific users, add them to the group owner.
Viewing Permissions
-: Regular filed: Directoryl: Symbolic links: Socketp: Pipeb: Block device
Changing Permissions (chmod)
Symbolic Method
Numeric Method
Permissions as octal numbers:| Number | Binary | Permissions |
|---|---|---|
| 0 | 000 | --- |
| 1 | 001 | —x |
| 2 | 010 | -w- |
| 3 | 011 | -wx |
| 4 | 100 | r— |
| 5 | 101 | r-x |
| 6 | 110 | rw- |
| 7 | 111 | rwx |
Changing Ownership (chown)
Special Permissions
SUID (Set User ID)
File executes with owner’s permissions:SGID (Set Group ID)
On files: Execute with group’s permissions On directories: New files inherit directory’s groupSticky Bit
On directories: Only file owner can delete files/tmp directory - users can create files but only delete their own.
umask
Default permissions for new files/directories:- Default file: 666 (rw-rw-rw-)
- Default directory: 777 (rwxrwxrwx)
- umask: Subtracts from defaults
Windows NTFS Permissions
NTFS supports detailed permissions, but basic concepts are similar:- Read: View files and folders
- Write: Create and modify files
- Execute: Run programs, access folders
FAT32 file system does NOT support permissions - all users have full access to all files.
- More granular permission control
- Explicit deny permissions
- Permission inheritance settings
- Can assign to specific users (not just owner/group/others)