Linux Hanged 1
1. Use TTY to Regain Control (Very Useful)
Even if the GUI is frozen, Linux still runs in the background. You can switch to a TTY (text console):
👉 Press:
css
Copy
Edit
Ctrl + Alt + F2 (or F3, F4... up to F6)
This brings you to a black screen asking for login. Log in with your username and password, then:
bash
Copy
Edit
htop
Or use:
bash
Copy
Edit
top
Find the highest CPU or memory usage process, and kill it:
bash
Copy
Edit
kill -9 <PID>
If you don’t have htop yet:
bash
Copy
Edit
sudo apt install htop
To return to the desktop GUI after killing the offending process:
👉 Press:
nginx
Copy
Edit
Ctrl + Alt + F1 (or sometimes F7, depending on distro)
🔹 2. Hard Reset as Last Resort
If TTY doesn't work (rare but possible), you can force a system reboot safely:
👉 Press:
nginx
Copy
Edit
Alt + SysRq + REISUB
That’s:
Alt + Print Screen (SysRq key) + type R E I S U B slowly.
It safely unmounts disks and reboots — better than holding the power button.
⚙️ How to Prevent Future Freezing
🔸 Check What’s Eating Resources
Use htop or gnome-system-monitor to watch:
Which apps use most RAM or CPU.
How much swap is used — if your system runs out of RAM and swap, it freezes.
🔸 Add Swap Space (Highly Recommended)
If your system has <4 GB RAM, freezing is likely due to no memory left.
To check if you have swap:
bash
Copy
Edit
free -h
If swap is 0, add it:
bash
Copy
Edit
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
To make it permanent:
bash
Copy
Edit
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
🧠Pro Tip: Background Services
Kali runs some pentesting tools/services automatically. Disable them unless needed:
bash
Copy
Edit
sudo systemctl disable postgresql
sudo systemctl disable apache2
sudo systemctl disable metasploit
✅ Summary
Problem Fix
System freezes Use TTY (Ctrl+Alt+F2), then kill heavy process
No task manager Install htop, use from terminal or TTY
RAM overload Add swap (especially if <4GB RAM)
Background tools Disable with systemctl disable
Let me know your system specs (RAM, CPU), and I’ll help you optimize even further.
Even if the GUI is frozen, Linux still runs in the background. You can switch to a TTY (text console):
👉 Press:
css
Copy
Edit
Ctrl + Alt + F2 (or F3, F4... up to F6)
This brings you to a black screen asking for login. Log in with your username and password, then:
bash
Copy
Edit
htop
Or use:
bash
Copy
Edit
top
Find the highest CPU or memory usage process, and kill it:
bash
Copy
Edit
kill -9 <PID>
If you don’t have htop yet:
bash
Copy
Edit
sudo apt install htop
To return to the desktop GUI after killing the offending process:
👉 Press:
nginx
Copy
Edit
Ctrl + Alt + F1 (or sometimes F7, depending on distro)
🔹 2. Hard Reset as Last Resort
If TTY doesn't work (rare but possible), you can force a system reboot safely:
👉 Press:
nginx
Copy
Edit
Alt + SysRq + REISUB
That’s:
Alt + Print Screen (SysRq key) + type R E I S U B slowly.
It safely unmounts disks and reboots — better than holding the power button.
⚙️ How to Prevent Future Freezing
🔸 Check What’s Eating Resources
Use htop or gnome-system-monitor to watch:
Which apps use most RAM or CPU.
How much swap is used — if your system runs out of RAM and swap, it freezes.
🔸 Add Swap Space (Highly Recommended)
If your system has <4 GB RAM, freezing is likely due to no memory left.
To check if you have swap:
bash
Copy
Edit
free -h
If swap is 0, add it:
bash
Copy
Edit
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
To make it permanent:
bash
Copy
Edit
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
🧠Pro Tip: Background Services
Kali runs some pentesting tools/services automatically. Disable them unless needed:
bash
Copy
Edit
sudo systemctl disable postgresql
sudo systemctl disable apache2
sudo systemctl disable metasploit
✅ Summary
Problem Fix
System freezes Use TTY (Ctrl+Alt+F2), then kill heavy process
No task manager Install htop, use from terminal or TTY
RAM overload Add swap (especially if <4GB RAM)
Background tools Disable with systemctl disable
Let me know your system specs (RAM, CPU), and I’ll help you optimize even further.
Comments
Post a Comment