Linux Fundamentals for Hackers — Part 2: Permissions, Processes, Automation & Real-World Usage
Linux Fundamentals for Hackers — Part 2: Permissions, Processes, Automation & Real-World Usage
This is where things become real.
Part 1 → Basics
Part 2 → Control + Power + Real Usage
If you understand this post properly,
you are no longer a beginner.
🔐 PERMISSIONS (DEEP UNDERSTANDING)
Linux security is built on permissions.
Every file has:
- Owner
- Group
- Others
And each has:
- r = read
- w = write
- x = execute
Example:
-rwxr-xr--🧠 BREAKDOWN
Owner → rwx (full control)
Group → r-x (read + execute)
Others → r-- (read only)
⚡ NUMERIC SYSTEM (IMPORTANT)
r = 4
w = 2
x = 1So:
7 = rwx
5 = r-x
4 = r--Example:
chmod 755 file🚨 CRITICAL WARNING
chmod 777 fileThis gives FULL access to everyone.
👉 This is one of the most common security mistakes.
🧠 EXECUTE PERMISSION EXPLAINED
For files:
- Allows execution
For directories:
- Allows entering (cd)
Without x → you cannot access directory contents.
👤 USERS & GROUPS
Check current user:
whoamiList users:
cat /etc/passwdAdd user:
sudo adduser user1Switch user:
su user1🧠 CYBERSECURITY INSIGHT
Most privilege escalation vulnerabilities
come from misconfigured users and permissions.
📊 PROCESS MANAGEMENT
Everything running in Linux is a process.
Show processes:
ps auxReal-time monitoring:
topBetter:
htop🔍 FIND PROCESS
ps aux | grep ssh❌ KILL PROCESS
kill PID
kill -9 PID🧠 REAL USE CASE
- Stop malicious processes
- Monitor attacks
- Debug applications
📂 SYSTEM LOGS (YOUR BEST FRIEND)
Logs are where truth lives.
Location:
/var/log/Important logs:
/var/log/syslog
/var/log/auth.log📄 READ LOGS
less /var/log/syslog
tail -f /var/log/auth.log🧠 CYBERSECURITY USE
- Detect brute force attempts
- Monitor SSH logins
- Investigate incidents
🔍 GREP (SEARCH LIKE A HACKER)
Search text:
grep "error" file.txtIgnore case:
grep -i "error" file.txtRecursive search:
grep -r "password" /etc/🔥 PRACTICAL EXAMPLE
Find credentials:
grep -r "pass" /var/⚙️ ENVIRONMENT VARIABLES
Show all:
envCheck PATH:
echo $PATH🧠 SECURITY INSIGHT
If PATH is manipulated,
attackers can execute malicious binaries.
📦 SERVICES (SYSTEM CONTROL)
Start:
sudo systemctl start apache2Stop:
sudo systemctl stop apache2Status:
sudo systemctl status apache2🧠 REAL USE CASE
- Manage servers
- Detect abnormal services
- Stop compromised services
🔗 SSH (REMOTE ACCESS - CRITICAL)
Connect to server:
ssh user@ipExample:
ssh root@192.168.1.10📁 TRANSFER FILES
Send file:
scp file.txt user@ip:/home/Download file:
scp user@ip:/home/file.txt .🧠 CYBERSECURITY USE
- Remote administration
- Lateral movement
- Data exfiltration
⏰ CRON JOBS (AUTOMATION)
Edit cron:
crontab -eExample:
* * * * * echo "hello" >> test.txt🧠 WHAT THIS MEANS
Runs every minute.
🚨 SECURITY RISK
Attackers use cron for persistence.
🧪 BASH SCRIPTING (REAL START)
Create script:
nano script.shExample:
#!/bin/bash
echo "Starting scan..."
nmap -sS 192.168.1.1
echo "Done"Make executable:
chmod +x script.shRun:
./script.sh🧠 WHY THIS MATTERS
This is how real tools are built.
⚡ ALIAS (SAVE TIME)
alias ll="ls -la"Make permanent:
nano ~/.bashrc🧠 PRO TIP
Hackers customize their terminal heavily.
🧪 ENUMERATION MINDSET (IMPORTANT SHIFT)
When you access a system:
You do NOT attack immediately.
You enumerate.
Check:
whoami
id
uname -a
ls -la
ps aux
netstat -tulnp🧠 THIS IS HOW HACKERS THINK
- What user am I?
- What permissions do I have?
- What is running?
- What can I abuse?
🚨 COMMON MISTAKES
- Using chmod without understanding
- Ignoring logs
- Skipping enumeration
- Blindly running commands
🧠 FINAL MINDSET
Linux is not about memorizing commands.
It is about:
- Understanding systems
- Observing behavior
- Controlling environments
🔥 FINAL MESSAGE
At this level:
You are no longer learning Linux.
You are starting to think like a hacker.