Back to blog

Linux Fundamentals for Hackers — Part 2: Permissions, Processes, Automation & Real-World Usage

Linux Fundamentals for Hackers — Part 2: Permissions, Processes, Automation & Real-World Usage

4 min read
by CyberTrick
LinuxCybersecurityBashSSHAutomationEthicalHackingCyberTrick

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 = 1

So:

7 = rwx
5 = r-x
4 = r--

Example:

BASH
chmod 755 file

🚨 CRITICAL WARNING

BASH
chmod 777 file

This 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:

BASH
whoami

List users:

BASH
cat /etc/passwd

Add user:

BASH
sudo adduser user1

Switch user:

BASH
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:

BASH
ps aux

Real-time monitoring:

BASH
top

Better:

BASH
htop

🔍 FIND PROCESS

BASH
ps aux | grep ssh

❌ KILL PROCESS

BASH
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

BASH
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:

BASH
grep "error" file.txt

Ignore case:

BASH
grep -i "error" file.txt

Recursive search:

BASH
grep -r "password" /etc/

🔥 PRACTICAL EXAMPLE

Find credentials:

BASH
grep -r "pass" /var/

⚙️ ENVIRONMENT VARIABLES

Show all:

BASH
env

Check PATH:

BASH
echo $PATH

🧠 SECURITY INSIGHT

If PATH is manipulated,
attackers can execute malicious binaries.


📦 SERVICES (SYSTEM CONTROL)

Start:

BASH
sudo systemctl start apache2

Stop:

BASH
sudo systemctl stop apache2

Status:

BASH
sudo systemctl status apache2

🧠 REAL USE CASE

  • Manage servers
  • Detect abnormal services
  • Stop compromised services

🔗 SSH (REMOTE ACCESS - CRITICAL)

Connect to server:

BASH
ssh user@ip

Example:

BASH
ssh root@192.168.1.10

📁 TRANSFER FILES

Send file:

BASH
scp file.txt user@ip:/home/

Download file:

BASH
scp user@ip:/home/file.txt .

🧠 CYBERSECURITY USE

  • Remote administration
  • Lateral movement
  • Data exfiltration

⏰ CRON JOBS (AUTOMATION)

Edit cron:

BASH
crontab -e

Example:

BASH
* * * * * echo "hello" >> test.txt

🧠 WHAT THIS MEANS

Runs every minute.


🚨 SECURITY RISK

Attackers use cron for persistence.


🧪 BASH SCRIPTING (REAL START)

Create script:

BASH
nano script.sh

Example:

BASH
#!/bin/bash

echo "Starting scan..."

nmap -sS 192.168.1.1

echo "Done"

Make executable:

BASH
chmod +x script.sh

Run:

BASH
./script.sh

🧠 WHY THIS MATTERS

This is how real tools are built.


⚡ ALIAS (SAVE TIME)

BASH
alias ll="ls -la"

Make permanent:

BASH
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:

BASH
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.