Careers

Linux Commands for Cyber Security: Beginner Cheat Sheet

Almost every security tool runs on Linux, and most servers you will defend or test run it too. You do not need to memorize hundreds of commands. Learn these, in a virtual machine you can break safely.

Move Around and Read Files

  • pwd shows where you are; ls -la lists files with permissions and hidden files; cd changes folder.
  • cat file prints a file; less file lets you scroll; head and tail show the start and end.
  • tail -f /var/log/auth.log follows a log live.
  • grep "Failed password" /var/log/auth.log finds lines containing text.
  • grep -r "password" /etc 2>/dev/null searches a folder tree.
  • find / -name "*.conf" 2>/dev/null finds files by name.

Permissions and Users

  • whoami and id show who you are.
  • chmod 600 file and chown user file change permissions and owner.
  • sudo runs a command as administrator. A file readable by everyone, or a program with a risky setuid bit, is a typical weakness; see privilege escalation explained.

Processes and Network

  • ps aux lists processes; top shows them live.
  • ip a shows addresses; ss -tulpn shows what is listening and which program owns it.
  • curl -I http://192.168.56.20/ fetches headers from a web server.

For the ideas behind these, read networking basics for cybersecurity.

Turn a Log into an Answer

Combine commands with pipes. This counts failed SSH logins per source address:

  • grep "Failed password" /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -nr

The address is usually the eleventh field, but lines for invalid users differ, so check your own log. This is the same thinking a SIEM applies at scale; see what is a SIEM.

Next Steps

Install Kali or Ubuntu in a VM (Kali Linux for beginners), practice daily for two weeks and keep a cheat sheet in your own words.

Sources and Further Reading

Starting from zero? Ask a counselor which first step suits you. Contact us or call +91 86868 92922.

Start Your Cyber Security Career

Talk to a counselor, choose the right course for your goals, and get the fee, syllabus and next batch dates in writing.

Book Free Trial Classes

By submitting, you agree that Hacking Trainer Academy may contact you about courses by phone, WhatsApp or email. See our privacy notice and refund policy.

WhatsApp