Linux Essentials for Practitioners
Filesystem navigation, permissions, process control, systemctl, and essential administrative utilities.
Overview
Linux constitutes the operational foundation of cybersecurity infrastructure, hosting environments, penetration testing distributions (Kali, Ubuntu), and embedded network appliances. Operating efficiently within the bash terminal is an indispensable prerequisite for vulnerability assessment, log investigation, and tool automation.
Core Concepts
- Unified Hierarchical Filesystem: Every storage device, process, and socket is mapped under a single root directory (
/). Everything in Linux is treated as a file. - Standard Permission Triad: Access rights are partitioned across User (owner), Group, and Other. Permissions consist of Read (
r=4), Write (w=2), and Execute (x=1). - Process Architecture: Programs run as processes identified by unique Process IDs (PIDs). Init/Systemd (PID 1) manages background system services.
Tools & Requirements
Standard Linux core utilities (GNU coreutils), Bash 5+, and systemd service management.
Commands & Practical Examples
1. Filesystem Navigation & Inspection
Verify current working directory, list all files with human-readable permissions, and change directory:
$ pwd; ls -lah; cd ~/Documents
2. Directory Management & Safe File Operations
Create nested folder hierarchies, copy files with overwrite prompts, and rename items:
$ mkdir -p projects/handbook/assets; cp -i notes.md backup/notes.md; mv draft.md final.md
rm -rf) does not use a trash bin. Verify the absolute path before executing deletion commands.
3. Security Permissions & Access Controls
Audit permissions, secure private SSH keys with strict owner-only access (600), and add script execution rights:
$ ls -l report.txt; chmod 600 ~/.ssh/id_ed25519; chmod u+x backup.sh
4. Process Monitoring & Service Control
List running system processes, launch interactive process viewer, and check service availability:
$ ps aux; top; systemctl status ssh
5. Searching Files and Content
Locate configuration files recursively and search for keyword patterns inside files:
$ find /etc -name "*.conf" 2>/dev/null $ grep -rn "password" /var/log/ 2>/dev/null
Practical Workflow
- Orientation: Always confirm current user (
whoami) and directory path (pwd) upon terminal connection. - File Verification: Inspect file permissions (
ls -l) before modifying or executing scripts. - Resource Review: Check memory and active network listeners (
ss -tulpn) before launching heavy tools.
Common Mistakes & Troubleshooting
- Running Everything as Root: Avoid conducting routine tasks as root. Use standard user accounts and invoke
sudoonly when administrative escalation is required. - Permissive SSH Keys: OpenSSH refuses connection if private key files have permissions greater than
600. - Unquoted Wildcards: Misusing wildcards with commands like
chowncan inadvertently change permissions across system files.
Security Considerations & Scoping
Enforce the Principle of Least Privilege across all personal lab machines. Ensure sensitive files in test environments are restricted from world-readable permissions.
Related Topics
- Module 07: Privilege Escalation (Educational Labs)
- Module 11: Linux System Security & Defensive Hardening
- Module 12: Security Automation with Python & Scripting
Further Reading & TryHackMe Paths
- TryHackMe Paths: Pre Security (Linux Fundamentals Parts 1โ3), Cyber Security 101.
- Offline Guide: Refer to
handbook/sources/linux-basics.pdfin the PDF Library.