Linux Admin for Defense Contractors
Linux System Administration Basics
The Linux Architecture
At the heart of any Linux system is its kernel. Think of the kernel as the engine of a car. It's the core component that manages the system's resources, like the CPU, memory, and peripherals. You don't interact with it directly, but it's what makes everything else run.
Sitting on top of the kernel is the shell. If the kernel is the engine, the shell is the dashboard, steering wheel, and pedals. It's an interface that takes your commands and tells the kernel what to do. When you type a command, the shell interprets it and passes the instructions to the kernel for execution.
Finally, you have the applications and utilities. These are the programs you use, from web browsers to system tools. They are like the passengers and cargo in the car, using the system to perform specific tasks.
This layered approach is what makes Linux so stable and flexible. Each layer has a distinct job, and they communicate in a structured way. As a system administrator, you'll spend most of your time working with the shell to manage the system.
The Command Line Is Your Cockpit
While modern Linux distributions have graphical user interfaces (GUIs), a system administrator's most powerful tool is the command-line interface (CLI). It’s a text-based way to interact with the system that offers precision, speed, and the ability to automate tasks in ways a GUI can't match.
Linux administration requires a good grasp of using the terminal, as most administrative tasks are done from the command line.
Let's start with three fundamental commands for navigating the file system. These are your absolute basics for moving around.
pwd(print working directory) tells you where you currently are in the system.ls(list) shows you the contents of your current directory.cd(change directory) lets you move to a different directory.
# Find out where you are
pwd
# List the files and folders in this location
ls
# Move into a directory named 'documents'
cd documents
Understanding the File System
In Linux, everything is treated as a file, even hardware devices. These files are organized in a hierarchical, tree-like structure. The top of the tree is the root directory, represented by a single slash (/). All other directories branch off from the root.
While there are many directories, a few are critical for system administration.
| Directory | Purpose |
|---|---|
/ | The root directory; where the entire hierarchy begins. |
/bin | Contains essential command-line utilities available to all users. |
/etc | Holds system-wide configuration files. |
/home | Contains the personal directories for each user. |
/var | Stores variable data like logs and temporary files. |
/usr | Contains user-installed software and utilities. |
Knowing what kind of information lives in these directories is key to finding configuration files, checking logs, and managing software.
Users and Groups
Linux is a multi-user system, meaning multiple people can have accounts on the same machine. To keep things secure and organized, Linux uses a system of users and groups. Every user has an account, and every file is owned by a specific user.
Users can also be organized into groups. This makes it easy to grant permissions to multiple people at once. For example, you could create a group called engineers and give that group read and write access to a specific project directory. Any user added to the engineers group will automatically get those permissions.
This user and group ownership model is fundamental to Linux security. It controls who can read, write, and execute files on the system.
You can add a new user with the useradd command and create a new group with groupadd. The id command is useful for checking which groups a user belongs to.
# Add a new user named 'jdoe'
sudo useradd jdoe
# Add a new group named 'analysts'
sudo groupadd analysts
# Add the user 'jdoe' to the 'analysts' group
sudo usermod -aG analysts jdoe
# Check the groups that 'jdoe' belongs to
id jdoe
Notice the sudo command. This stands for "superuser do" and allows a permitted user to execute a command as the superuser or another user. It's how you perform administrative tasks without being logged in as the all-powerful root user all the time.
Basic Networking
Networking is a vast topic, but every system administrator needs to know the basics of checking connectivity and finding a system's network identity.
Every device on a network has an IP address, which is a unique identifier like a street address for a house. You can see the IP addresses of your system's network interfaces using the ip command.
# Show information about your network interfaces
ip addr
Another essential tool is ping. It sends a small packet of data to another machine on the network to see if it responds. It's the simplest way to check if a remote system is online and reachable.
# Ping google.com to check internet connectivity
ping google.com
These simple tools are often the first step in troubleshooting any network-related issue.
In the analogy of a Linux system as a car, which component is compared to the engine?
Which command would you use to find out your current location within the Linux file system?
With these foundations, you have the building blocks for managing a Linux system. Understanding the architecture, navigating from the command line, knowing the file structure, and managing users are the daily tasks of a Linux administrator.
