Linux System Administration and Shell Scripting

Chapter 7
Linux Networking and Remote Administration

Post Graduate Program in Dev Ops
Linux System Administration and Shell Scripting   •   Post Graduate

7. Linux Networking and Remote Administration

Introduction and Context

Linux systems rarely operate in isolation. A web server retrieves data from a database, a container image is downloaded from a registry, administrators connect through secure remote sessions, and monitoring systems collect metrics over the network. Consequently, networking is not an optional extension of Linux administration; it is one of the principal environments in which administration takes place.

Linux networking combines several layers of responsibility. An administrator must understand how an interface obtains an address, how the kernel selects a route, how names are resolved through DNS, how applications communicate through sockets, how remote access is authenticated and controlled, and how traffic is filtered. These tasks are closely related. A DNS failure may appear to be an application problem, while a missing route may be mistaken for a firewall block. Effective administration therefore depends not only on knowing commands, but also on interpreting evidence systematically.

This chapter develops a practical and conceptual framework for configuring and diagnosing Linux networks. It also examines SSH-based remote administration, time synchronization, firewall design, automation, and the security and governance implications of administering systems at scale.

Learning Objectives

By the end of this chapter, students should be able to:

  • explain Linux addressing, routing, DNS, sockets, and network interface management;
  • configure and inspect IPv4 and IPv6 network settings using contemporary Linux tools;
  • diagnose connectivity problems using a layered troubleshooting method;
  • administer systems securely with SSH, keys, access controls, and automation;
  • explain the importance of time synchronization for security and distributed systems;
  • design and inspect host-based firewall policies;
  • evaluate operational risks, governance requirements, and common administrative errors;
  • apply these concepts to a realistic infrastructure incident.

The Linux Networking Model

A useful way to understand Linux networking is to move from the physical or virtual interface toward the application. A network interface, such as `eth0`, `ens160`, or `enp1s0`, provides access to a link. The interface may be physical, virtual, bonded, bridged, wireless, or part of a container or virtual-machine network. The kernel associates one or more addresses with it and maintains routing information that determines where packets should be sent.

Above this layer, transport protocols provide communication behavior. TCP establishes a reliable, ordered byte stream, whereas UDP provides connectionless datagrams with less protocol overhead. Applications use sockets as operating-system abstractions for communication. A socket is commonly identified by an address, a transport protocol, and a port. For example, a web service may listen on TCP port 443, while an SSH server normally listens on TCP port 22.

The process of reaching a service can therefore be represented as:

1. The client resolves a name, if a name rather than an address is supplied.

2. The client selects a route to the destination address.

3. The packet leaves through an interface and may pass through gateways and firewalls.

4. The server receives the connection on a listening socket.

5. Authentication and application-level authorization determine whether access is permitted.

Failure at any stage produces a different class of problem. A disciplined administrator tests these stages separately rather than changing several configurations at once.

Interfaces, Addresses, and Network Identity

The `ip` command is the principal modern tool for inspecting and configuring Linux network state. `ip link show` displays interfaces and their administrative and operational states. An interface can be administratively enabled with `ip link set dev enp1s0 up`, although persistent configuration should normally be managed by the distribution's network manager or declarative configuration system.

Addresses are inspected with:

```bash

ip address show

ip -4 address show dev enp1s0

ip -6 address show dev enp1s0

```

An IPv4 address consists of a 32-bit address and a prefix length. For example, `192.0.2.25/24` indicates that the first 24 bits identify the network. A `/24` prefix traditionally corresponds to the subnet mask `255.255.255.0`, but prefix notation is more concise and less error-prone. IPv6 uses 128-bit addresses and commonly employs prefixes such as `/64` for a subnet.

Administrators should distinguish three related concepts:

  • Address: the identifier assigned to an interface.
  • Prefix: the portion that identifies the local network.
  • Gateway: a next-hop router used to reach destinations outside the local network.

An address may be statically configured or dynamically assigned through DHCP. IPv6 may additionally use router advertisements and Stateless Address Autoconfiguration. Dynamic assignment simplifies provisioning, but servers requiring stable identity often use reservations, static configuration, or an infrastructure management system.

The loopback interface, normally `lo`, provides local host communication. The address `127.0.0.1` in IPv4 and `::1` in IPv6 refer to the local system. A service bound only to loopback is inaccessible through external interfaces, which is often a deliberate security choice for databases and internal management endpoints.

Network configuration is persistent only when written to the operating system's configuration framework. Depending on the distribution and deployment environment, this may involve NetworkManager, systemd-networkd, Netplan, or another management layer. Direct `ip` commands are valuable for testing, but they may disappear after a reboot or service restart. This distinction between runtime state and desired state is central to reliable administration.

Routing: How the Kernel Chooses a Path

Routing determines where packets go. The kernel compares a destination address with its routing table and selects the most specific matching route. This is known as longest-prefix matching. A route for `192.0.2.0/24` is preferred over a route for `192.0.0.0/16` when the destination belongs to both networks.

Routes can be inspected with:

```bash

ip route show

ip -6 route show

ip route get 8.8.8.8

```

A typical IPv4 table may contain a directly connected network and a default route:

```text

default via 192.0.2.1 dev enp1s0

192.0.2.0/24 dev enp1s0 proto kernel scope link src 192.0.2.25

```

The default route is used when no more specific route exists. The gateway must generally be reachable through an appropriate local interface and subnet. A missing default route permits communication with local systems but prevents access to remote networks.

Temporary route changes can be made with commands such as:

```bash

sudo ip route add 198.51.100.0/24 via 192.0.2.1 dev enp1s0

sudo ip route del 198.51.100.0/24

```

In production, persistent routes should be declared through the system's network configuration or provisioning code. Multiple interfaces introduce policy questions: which interface should carry default traffic, which source address should be selected, and whether traffic from different networks requires policy routing? Advanced environments may use multiple routing tables and rules inspected with `ip rule`.

The `traceroute` or `tracepath` utilities help reveal the path toward a destination, but their results require interpretation. Routers may suppress diagnostic messages, use asymmetric paths, or rate-limit responses. Asterisks in a trace do not automatically prove that a router is blocking application traffic.

DNS and Name Resolution

The Domain Name System translates names into addresses and supports other records used by distributed systems. Common record types include A for IPv4 addresses, AAAA for IPv6 addresses, CNAME for aliases, MX for mail exchange, and TXT for text-based data such as verification or policy information.

Linux name resolution is not limited to DNS. The Name Service Switch configuration, commonly in `/etc/nsswitch.conf`, defines the order in which sources are consulted for categories such as hosts and users. A hosts entry in `/etc/hosts` may therefore take precedence over DNS, depending on configuration. This can be useful for controlled testing but can also create misleading results when stale entries remain.

Resolver settings may be represented in `/etc/resolv.conf`, managed by a local resolver such as `systemd-resolved`, or supplied by NetworkManager. The commands below support investigation:

```bash

getent hosts server.example.com

resolvectl status

resolvectl query server.example.com

dig server.example.com A

dig server.example.com AAAA

```

`getent` tests the system's configured name-service path, while `dig` performs detailed DNS queries and is useful for examining authoritative answers, TTL values, delegation, and response status. A successful `ping` to a name does not prove that every application will resolve it identically, because applications may use different libraries, caches, or address-selection behavior.

DNS failures may result from an unavailable resolver, incorrect search domains, expired or stale records, split-horizon DNS, DNSSEC validation problems, or simple application misconfiguration. Administrators should first test resolution of a known name, then query the configured resolver directly, and finally compare results with an independent resolver where policy permits.

Sockets, Ports, and Services

A listening service creates a socket bound to an address and port. The binding may be specific, such as `127.0.0.1:5432`, or wildcard-based, such as `0.0.0.0:5432` or `[::]:5432`. A wildcard binding can expose a service on every suitable interface and should therefore be reviewed carefully.

The principal inspection tool is `ss`:

```bash

ss -tulpen

ss -tan state established

sudo ss -ltnp

```

The flags commonly indicate TCP, UDP, listening, numeric output, process information, and extended details. Port inspection should be combined with service-manager information, such as `systemctl status ssh`, and package or application configuration review.

A connection refused response usually means that the destination is reachable but no service is accepting the connection, or that an active device is rejecting it. A timeout may indicate packet filtering, routing failure, an unavailable host, or a service that is not responding. These interpretations are useful hypotheses, not absolute rules.

The loopback address, wildcard addresses, IPv4-mapped IPv6 behavior, and dual-stack configuration can produce unexpected exposure. A security review should ask not merely which ports are open, but on which addresses they are listening, from which networks they are reachable, and what authentication protects them.

A Layered Method for Network Diagnosis

Network troubleshooting is most efficient when evidence is gathered from the lower layers upward. A practical sequence is:

1. Local interface: Is the expected interface present and up? Use `ip link` and inspect kernel logs.

2. Local address: Does the interface have an appropriate address and prefix? Use `ip address`.

3. Local route: Can the kernel identify a route to the destination? Use `ip route get destination`.

4. Neighbor resolution: For local networks, is the next device visible through ARP or IPv6 Neighbor Discovery? Use `ip neigh`.

5. Gateway and path: Test a gateway and use `tracepath` or carefully selected probes.

6. Name resolution: Compare a name-based test with a direct address-based test using `getent` or `dig`.

7. Transport port: Test the service port with tools such as `nc -vz host port` where authorized.

8. Application protocol: Use protocol-aware tools, logs, and health checks.

`ping` uses ICMP and is useful but not definitive. Many networks block ICMP while allowing TCP, and some hosts rate-limit or ignore echo requests. Packet capture with `tcpdump` provides direct evidence:

```bash

sudo tcpdump -ni enp1s0 host 192.0.2.40 and port 443

```

Capture should be performed with a clear question and stopped promptly. It may reveal retransmissions, resets, failed DNS requests, incorrect source addresses, or traffic that never leaves the host. Because packet captures may contain credentials, tokens, personal data, or business information, they must be handled under organizational policy.

SSH as the Foundation of Remote Administration

Secure Shell provides encrypted remote login, command execution, file transfer, and tunneling. Its security depends on both cryptography and operational controls. A typical connection is initiated with:

```bash

ssh [email protected]

```

The client verifies the server's host key against known-hosts data. This protects against certain man-in-the-middle attacks, provided that initial key verification is performed through a trusted channel. Blindly accepting changed host keys defeats this protection. A changed key may indicate legitimate reinstallation, but it may also indicate interception.

Key-based authentication is generally preferable to reusable passwords for administrative access. A key pair consists of a private key, which must remain confidential, and a public key installed in the account's `authorized_keys` file. Modern key types and algorithms should be selected according to current organizational policy. Private keys should have restrictive permissions and may be protected by a passphrase and an agent.

Important SSH controls include disabling direct root login where operationally appropriate, limiting access to approved users or groups, using `sudo` for privileged actions, applying multi-factor authentication for sensitive environments, and restricting forwarding features when they are not required. A hardened SSH configuration should be tested with a separate session before reloading or restarting the daemon; otherwise, an administrator may lock out all remote access.

SSH also supports secure copying and automation:

```bash

scp configuration.conf admin@server:/tmp/

ssh -o BatchMode=yes admin@server 'sudo systemctl reload nginx'

```

For repeated administration, tools such as Ansible use SSH as a transport while adding inventory, idempotent tasks, privilege escalation, and auditability. Automation should use dedicated accounts with narrowly scoped permissions rather than personal credentials shared across operators.

SSH agent forwarding deserves special caution. Forwarding allows a remote host to use keys available through the local agent, but a compromised remote host may abuse that forwarding channel while the session is active. Bastion hosts, short-lived credentials, certificate-based SSH, and session recording can provide stronger control in larger environments.

Time Synchronization and Trustworthy Operations

Correct time is essential to authentication protocols, certificate validation, log correlation, distributed tracing, scheduled jobs, and incident investigation. Linux systems commonly synchronize time using NTP or chrony. The administrator should distinguish system clock time from the hardware clock and understand whether the system is synchronized, merely configured with a source, or operating in an unsynchronized state.

Typical inspection commands include:

```bash

timedatectl status

chronyc tracking

chronyc sources -v

```

Time services adjust clocks gradually in normal operation to avoid disrupting applications. Large offsets may require special handling. A server should use trusted and redundant time sources, and network policy should restrict who can query or provide time. In virtualized and cloud environments, the platform may provide an additional time mechanism; administrators must avoid competing services that continually correct the clock in opposite directions.

Time synchronization is also a security control. Kerberos tickets, signed logs, certificates, and replay protections often depend on bounded clock differences. An incident-response timeline constructed from unsynchronized hosts can lead to incorrect conclusions.

Host Firewalls and Policy Design

A firewall enforces a policy about which traffic is permitted, rejected, or logged. Linux packet filtering is implemented through kernel facilities and managed through tools such as nftables, firewalld, or distribution-specific front ends. The modern nftables framework supports tables, chains, sets, counters, and stateful filtering. Firewalld provides zones and a management abstraction suitable for many operational environments.

A firewall policy should be designed from required communication rather than from a list of arbitrary ports. Questions include:

  • Which services must be reachable?
  • From which source networks?
  • Over which protocol and destination ports?
  • Is return traffic allowed through connection tracking?
  • Should denied traffic be logged, and at what rate?
  • How will emergency access be preserved?

A default-deny posture is often appropriate for inbound traffic, followed by explicit rules for SSH management networks, web services, monitoring, and required application dependencies. Outbound traffic may also require control in high-assurance environments, although unrestricted outbound access is common in less restrictive networks.

Firewall rules must be understood in relation to cloud security groups, load balancers, container networking, and upstream network controls. A packet may be denied before it reaches the host, or accepted by the host and then rejected by an application. Stateful rules, rule order, address-family differences, and overlapping zones are frequent sources of error.

Firewall configuration is an operational safety issue. Changes should be version-controlled, tested from an existing session, and accompanied by a rollback mechanism. Administrators should maintain an out-of-band recovery path where possible. Logging must be selective because excessive denied-packet logging can consume storage and obscure significant events.

Administration at Scale: From Commands to Desired State

Managing one server interactively is different from managing hundreds or thousands of systems. At scale, manual SSH commands create inconsistency, weak audit trails, and configuration drift. Infrastructure teams therefore express desired state through code, inventories, templates, and policy controls.

Ansible, for example, can distribute authorized keys, configure DNS settings, deploy firewall policies, and ensure that time synchronization is enabled. Idempotence is a central principle: running the same task repeatedly should converge the system toward the same state without unnecessary changes. Secrets should be stored in dedicated secret-management systems rather than in plain-text playbooks.

Automation does not eliminate the need for understanding. A faulty route template can disconnect an entire fleet; an incorrect firewall rule can block monitoring or management; and a broad SSH key deployment can create systemic compromise. Safe automation includes staged rollout, health checks, approval gates, immutable or versioned configuration, least privilege, and tested rollback.

Centralized logging and monitoring complement configuration automation. Useful indicators include interface errors, packet drops, DNS latency, TCP retransmissions, SSH authentication failures, clock offset, firewall counters, and certificate expiry. Observability should connect infrastructure symptoms with service-level outcomes rather than treating network metrics as isolated technical data.

Illustrative Case Study: Intermittent Failure of an Internal Deployment Service

Background

A fictional organization operates a private software-distribution service at `packages.dev.example`. Linux build agents use it to download dependencies. The service is hosted on an internal network and is intended to be reachable only by development and build subnets.

Situation and Problem

Builds begin failing intermittently. Some agents report “repository unavailable,” while others continue to work. Administrators initially suspect the package service because its application logs show no corresponding request from several failing agents.

Analysis

The team begins with a layered comparison between a working and failing agent. `ip address` shows that both interfaces are operational. `ip route get` reveals that the failing agents select a new default gateway introduced during a network migration. The route to the package-service subnet is absent, so traffic follows the default route toward a firewall that does not permit the private destination.

A second problem is discovered: the failing agents resolve the service name to an IPv6 address because their DNS response contains an AAAA record. The new network does not yet provide a usable IPv6 path. Applications that prefer IPv6 wait for connection timeout before attempting IPv4, making the failure appear intermittent.

The team confirms these findings with `getent hosts`, `dig`, `ip -6 route`, and a targeted `tcpdump` capture. The capture shows IPv6 connection attempts leaving the host without successful replies. On working agents, a specific IPv4 route exists and IPv4 is selected immediately.

Approach and Solution

The organization adopts a four-part solution. First, the correct route to the package-service subnet is declared in the network configuration managed by automation. Second, IPv6 routing is either completed for the relevant networks or the service's AAAA record is withheld until the path is operational, following change-control approval. Third, a health check tests both DNS resolution and the repository's HTTPS endpoint from representative build subnets. Finally, deployment agents are configured with monitoring for route changes, DNS latency, and repeated connection timeouts.

The team avoids simply disabling IPv6 globally because that would conceal the architectural problem and could affect unrelated services. Instead, it aligns DNS publication with actual network capability and establishes a documented migration plan.

Outcome

Build reliability returns to normal. The incident also results in a standard diagnostic runbook that distinguishes name-resolution, address-family, routing, firewall, and application failures. Network configuration is moved into version control, and changes are rolled out first to a small canary group.

Learning Points

The case demonstrates that an application error may originate in routing or address selection. It also illustrates why dual-stack deployments must be complete rather than merely enabled, why runtime fixes must be made persistent, and why comparing successful and failing hosts is often more informative than inspecting only the central service.

Security, Governance, and Professional Practice

Remote administration creates concentrated authority. A compromised administrative key, bastion host, or automation controller may provide access to many systems. Organizations should therefore define ownership, approval procedures, access reviews, retention requirements, and emergency-access processes.

Least privilege should apply to users, service accounts, SSH keys, automation roles, firewall rules, and network reachability. Administrative actions should be attributable to individuals or controlled service identities. Shared accounts weaken accountability and complicate revocation. Access should be removed promptly when roles change or employment ends.

Network data may contain personal information, credentials, customer content, or confidential business activity. Packet captures, command histories, SSH session logs, DNS logs, and firewall logs should be collected only for legitimate purposes, protected against unauthorized access, and retained according to policy and applicable law. Administrators must distinguish authorized security testing from intrusive scanning or interception.

Common technical mistakes include changing live networking without a recovery path, accepting unknown SSH host keys, exposing services on wildcard addresses, relying on `ping` as the only test, editing generated resolver files directly, deploying unreviewed firewall rules, storing private keys in repositories, and assuming that a successful TCP connection proves application health. Professional practice replaces assumptions with observable evidence and controlled change.

Emerging Directions

Linux networking is increasingly shaped by cloud platforms, containers, service meshes, software-defined networking, and IPv6 adoption. Container systems create virtual interfaces, bridges, namespaces, and policy layers that may be invisible to administrators who inspect only the host's primary interface. eBPF-based tools can provide high-resolution observability and programmable packet processing, but they require careful governance and specialist knowledge.

Zero-trust approaches reduce reliance on a trusted network location. Identity, device posture, workload identity, and explicit authorization become more important than simply placing a host inside a private subnet. SSH certificates, short-lived credentials, just-in-time access, and identity-aware proxies support this direction.

Automation is also becoming more policy-driven. Network configuration, firewall rules, DNS records, certificates, and access permissions can be validated in CI pipelines before deployment. AI-assisted operations may help classify anomalies or summarize logs, but generated recommendations must be checked against authoritative evidence. Automated remediation should be bounded by clear permissions, approval thresholds, and rollback mechanisms.

Best-Practice Checklist

A professionally managed Linux network generally follows these principles:

  • distinguish temporary runtime commands from persistent configuration;
  • document interface, address, route, DNS, time, and firewall ownership;
  • use least privilege and key-based, preferably multifactor, SSH access;
  • verify host keys and protect private credentials;
  • test networking from the lower layers upward;
  • inspect listening addresses, not merely port numbers;
  • maintain synchronized time and redundant trusted sources;
  • define firewall policy explicitly and preserve a recovery path;
  • manage fleet configuration through reviewed, idempotent automation;
  • monitor network behavior and correlate it with service health;
  • stage changes, use canaries, and retain tested rollback procedures;
  • protect logs and packet captures as potentially sensitive information.

Chapter Summary

Linux networking joins interfaces, addresses, routes, name resolution, transport protocols, sockets, services, and security controls into one operational system. The `ip` command reveals interface, address, route, neighbor, and policy state; DNS tools explain name-resolution behavior; `ss` exposes listening and established sockets; and packet capture provides direct evidence about traffic. Reliable diagnosis proceeds from local interface and addressing through routing, resolution, transport, and application behavior.

SSH is the principal mechanism for secure remote administration, but its value depends on host-key verification, protected credentials, least privilege, multifactor controls, and careful management of forwarding and automation. Time synchronization supports authentication, certificates, logs, and distributed coordination. Host firewalls should express explicit communication policy and be managed safely alongside cloud and container controls. At scale, desired-state automation, monitoring, staged deployment, governance, and rollback are as important as individual commands. The central professional skill is not memorizing utilities; it is forming and testing accurate hypotheses from observable system evidence.

Key Terms

Address: A numerical identifier assigned to a network interface.

Prefix length: The number of address bits identifying the network portion of an IP address.

Default route: The route used when no more specific route matches a destination.

Gateway: A next-hop router through which traffic reaches another network.

DNS: A distributed naming system that maps domain names to addresses and other records.

Name Service Switch: Linux configuration that determines the order and sources used for name and identity lookups.

Socket: An operating-system endpoint through which a process communicates over a network.

Port: A transport-layer number identifying an application endpoint.

Loopback: A local interface used for communication within the same host.

Longest-prefix matching: Routing behavior in which the most specific matching network route is selected.

SSH: An encrypted protocol for remote login, command execution, and secure transport.

Host key: A cryptographic identity used by an SSH server and verified by clients.

NTP: A protocol used to synchronize computer clocks over networks.

Chrony: A Linux time-synchronization implementation and management tool.

Firewall: A control that permits, rejects, or logs network traffic according to policy.

Stateful filtering: Firewall behavior that tracks connection state and permits related return traffic.

Idempotence: The property that repeating an automation operation produces the same intended state.

Packet capture: Recording network packets for analysis and troubleshooting.

Policy routing: Routing based on rules or attributes beyond the ordinary destination-prefix lookup.

Configuration drift: Divergence between systems or between declared desired state and actual state.

Review Questions

Short Answer Questions

1. What is the difference between an IP address, a prefix, and a gateway?

2. Why can a service bound to `127.0.0.1` not normally be reached from another host?

3. What information does `ss -ltnp` provide?

4. Why is accurate time important for SSH, certificates, and incident investigation?

5. What is the purpose of `ip route get` during troubleshooting?

Long Answer Questions

1. Explain the relationship among interfaces, addresses, routes, sockets, and application services in a Linux host.

2. Describe a layered method for diagnosing a server that cannot reach an HTTPS service by name.

3. Discuss the security controls required for responsible SSH-based remote administration.

4. Explain how firewall policy should be designed, tested, deployed, and governed in a production environment.

5. Compare interactive administration with desired-state automation for a large Linux fleet.

Analytical / Application Questions

1. A server can reach its gateway and can resolve a database hostname, but TCP connections to the database time out. Identify the next evidence you would collect and explain at least three possible causes.

2. An application works when accessed by IPv4 but fails when users connect through its hostname. Develop a diagnostic plan involving DNS, address selection, routing, and sockets.

3. An administrator changes a firewall remotely and loses access to the server. Analyze the procedural failures and propose a safer change and rollback process.

22. Multiple Choice Questions with Answers

Question 1

A Linux host has routes for 192.0.2.0/24 and 192.0.0.0/16. Which route is preferred for destination 192.0.2.40?

A. The 192.0.0.0/16 route because it is listed first

B. The 192.0.2.0/24 route because it is more specific

C. The default route because the destination is remote

D. Both routes simultaneously with equal priority

Correct Answer: B. The 192.0.2.0/24 route because it is more specific

Question 2

Which command tests the route that the kernel would use for a particular destination?

A. ip route get 8.8.8.8

B. ss -ltnp

C. dig 8.8.8.8

D. timedatectl status

Correct Answer: A. ip route get 8.8.8.8

Question 3

A service is listening on 127.0.0.1:5432. What is the most accurate implication?

A. It is reachable from every network interface

B. It is reachable only through IPv6

C. It is normally limited to local-host connections

D. It cannot accept any connections

Correct Answer: C. It is normally limited to local-host connections

Question 4

Why should an administrator use getent as well as dig when investigating name resolution?

A. getent checks the configured system name-service path, while dig performs DNS-oriented queries

B. dig tests routing, while getent tests firewall rules

C. getent can inspect SSH keys, while dig inspects sockets

D. They are identical commands with different output formats

Correct Answer: A. getent checks the configured system name-service path, while dig performs DNS-oriented queries

Question 5

Which observation most strongly suggests a missing route rather than a DNS problem?

A. A hostname resolves to an IP address, but ip route get shows no usable path

B. A hostname cannot be converted into an IP address

C. The DNS server returns an NXDOMAIN response

D. The local resolver configuration contains a search domain

Correct Answer: A. A hostname resolves to an IP address, but ip route get shows no usable path

Question 6

What is the primary security role of an SSH server host key?

A. It encrypts every user's private key

B. It identifies the server so the client can detect unexpected server changes

C. It grants root privileges to the connecting user

D. It replaces the need for user authentication

Correct Answer: B. It identifies the server so the client can detect unexpected server changes

Question 7

Why is unrestricted SSH agent forwarding risky?

A. It disables encryption between the client and server

B. A compromised remote host may use the forwarded agent during the session

C. It prevents public-key authentication from working

D. It automatically exposes the user's private key file

Correct Answer: B. A compromised remote host may use the forwarded agent during the session

Question 8

Which condition best explains why accurate time is important in a distributed Linux environment?

A. Time synchronization increases interface bandwidth

B. Clock accuracy supports authentication validity, certificate checks, and log correlation

C. NTP replaces the need for DNS

D. Correct time guarantees that all firewall rules are valid

Correct Answer: B. Clock accuracy supports authentication validity, certificate checks, and log correlation

Question 9

A firewall policy is changed on a remote production server. Which practice most reduces the risk of lockout?

A. Delete all existing rules before adding replacements

B. Apply the change without testing because firewalls are reversible

C. Maintain an active recovery session and prepare a tested rollback

D. Disable SSH before applying the policy

Correct Answer: C. Maintain an active recovery session and prepare a tested rollback

Question 10

In fleet automation, what does idempotence mean?

A. Every server receives a unique and unrelated configuration

B. Repeated execution converges systems toward the same intended state

C. Automation runs only once and cannot be repeated

D. All administrative actions are performed manually

Correct Answer: B. Repeated execution converges systems toward the same intended state

Linux System Administration and Shell Scripting
Chapter 7 of 15