Skip to content

Foundations

Linux is an open-source operating system kernel. When people say "I use Linux," they usually refer to a distribution(distro) - a combination of the kernel and a set of useful software (command line tools, desktop environments, drivers).

Unlike Windows or macOS, Linux was built by the community. It is legally free to copy, modify, and study "under the hood."


Why is Linux the King of Servers?

If you walk into any data center, there is a 99% chance the machines are running Linux. Here is why:

  1. Open Source & Cost: There are no licensing fees for every virtual machine you create. This results in massive savings for businesses.

  2. Stability: Linux servers can run for years without a reboot. Software updates often don't require the system to restart.

  3. Security: The Linux permission model was designed for multi-user systems from day one. Vulnerabilities in open-source code are often found and patched much faster.

  4. Performance: The system is incredibly flexible. You can run a server without a Graphical User Interface (GUI), saving all hardware resources for the actual tasks.

  5. Automation: Everything in Linux can be managed via text (scripts), making it a perfect match for modern Cloud and DevOps technologies.


Best Practices: Using Linux the Right Way

If you are starting to administer a server, try to follow these "golden rules":

1. Security First

  • Never work as root: Use a regular user and the sudo command for administrative tasks. This prevents "fatal" typos from destroying the system.

  • SSH Keys: Forget about passwords for server login. Set up SSH key-based authentication and disable password login in /etc/ssh/sshd_config.

  • Minimize Software: Don’t install anything unnecessary. Fewer programs mean a smaller "attack surface" for hackers.

2. System Hygiene

  • Update Regularly: Run apt update && apt upgrade (or your distro's equivalent) frequently to patch security holes.

  • Logs are Your Best Friend: If something breaks, check /var/log first. Tools like journalctl will help you understand what went wrong.

  • Naming Conventions: Name files and folders without spaces (use _ or -) and stick to lowercase Latin characters to avoid script errors.

3. Workflow Culture

  • Automate Everything: If you find yourself typing the same command for the third time, write a Bash script.

  • Backups: The "3-2-1" rule (3 copies, 2 different media, 1 offsite) is vital.

  • Configuration as Code: Document changes to system configs or use automation tools like Ansible.

Sections

Practical Notes

  • Start here when the issue is below the application layer.
  • Use the command references and concepts together.
  • Use the data format pages when the docs talk about YAML, JSON, HCL, or state.