User and Group Management
Managing users and groups is a critical aspect of Linux system administration. These commands allow you to create, modify, and delete user accounts, set passwords, and manage group memberships. Proper user and group management ensures secure access control and resource allocation within the system.
Command |
Description |
Example |
---|---|---|
passwd |
Change or set user password. |
passwd user1
Changes the password for user named “user1”. |
chpasswd |
Change passwords in bulk using a text file. |
chpasswd < user_passwords.txt
Reads passwords from a file and sets them for respective users. |
chage |
Set aging properties for user passwords (expiration, warning period). |
chage -M 90 user1
Sets maximum password age to 90 days for user “user1”. |
useradd |
Create a new user account. |
useradd -m user2
Creates a new user “user2” and creates a home directory for them. |
usermod |
Modify existing user account settings (e.g., change username, home directory, group membership). |
usermod -l newuser olduser
Renames user “olduser” to “newuser”. |
userdel |
Delete a user account. |
userdel user2
Deletes the user account “user2”. |
groupadd |
Create a new group. |
groupadd group1
Creates a new group named “group1”. |
groupmod |
Modify existing group settings (e.g., change group name or GID). |
groupmod -n newgroup oldgroup
Renames group “oldgroup” to “newgroup”. |
groupdel |
Delete a group. |
groupdel group1
Deletes the group named “group1”. |
Linux Security Command Cheat Sheet
Maintaining a secure and hardened Linux system is crucial in today’s threat-laden digital landscape. This comprehensive Linux Security Command Cheat Sheet serves as an invaluable resource for system administrators and security professionals, providing a concise reference to essential commands spanning various security domains. From user and group management to privilege escalation, file system security, process monitoring, firewall configuration, and security scanning, this guide covers a wide array of tools and utilities tailored for fortifying Linux environments.
Whether you’re managing access controls, auditing system events, securing network communications, or proactively detecting and mitigating potential threats, this cheat sheet equips you with the necessary knowledge to navigate through the vast arsenal of Linux security commands. With practical examples and clear descriptions, this resource empowers you to effectively secure, harden, and maintain the integrity of your Linux systems, ensuring robust protection against evolving cyber threats.
Linux Security Command Cheat Sheet
- User and Group Management
- Privilege Management
- File and Directory Management
- Process Management
- Firewall and Security
- Networking and Security Tools
- Security Scanners