📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Linux Command Line Users and Sudoers

Users and Sudoers

5 min read
Edit sudoers with visudo only — it validates syntax before saving to prevent lockouts. username ALL=(ALL) ALL grants full sudo. NOPASSWD: /path/command allows running a specific command without a password.

Sudoers Configuration

sudo visudo    # always use visudo to edit!

# Allow alice to run any command
alice ALL=(ALL:ALL) ALL

# Allow without password
alice ALL=(ALL) NOPASSWD: ALL

# Allow only specific commands
alice ALL=(ALL) /usr/bin/systemctl restart nginx,
                /usr/bin/systemctl status nginx