Ubuntu User & Group Management
Intermediatev1.0.0
Manage Ubuntu users and groups — creating service accounts, configuring sudo access, SSH key deployment, password policies, and PAM module configuration for multi-user servers.
Content
Overview
Proper user management is the foundation of Linux security. Every person gets their own account, every service gets a dedicated system user, and sudo provides controlled privilege escalation. No shared accounts, no direct root login.
Why This Matters
- -Shared accounts make it impossible to audit who did what
- -Service-specific users limit the blast radius of compromised services
- -sudo provides an audit trail of privilege escalation
User Management
Step 1: Create User Accounts
Step 2: Configure sudo Access
Step 3: Deploy SSH Keys
Step 4: Manage Groups
Step 5: Remove Users Safely
Best Practices
- -One account per person — never share accounts
- -One system user per service — never run services as root
- -Use SSH keys only — disable password authentication
- -Grant minimum sudo permissions — not blanket sudo access
- -Lock accounts immediately when people leave the team
- -Use groups for shared resource access (not world-readable permissions)
- -Review /etc/sudoers.d/ regularly for stale permissions
Common Mistakes
- -Sharing the root or deploy user account across the team
- -Granting NOPASSWD: ALL in sudoers (should be specific commands)
- -Not locking accounts when team members leave
- -Using adduser for service accounts (should use useradd --system)
- -Setting passwords on system user accounts (should use --shell /usr/sbin/nologin)
FAQ
Discussion
Loading comments...