Installing a network service

The fixed procedure, from package to test from a client: configure, start and enable, check that it listens, open the firewall, read the logs, using a web server and an SSH server as examples.

  • 22 cards
  • 4 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. Scenarios

A few cards from the deck

  • Enabling a service: what is it?

    Show the answer

    Making it start at every boot of the machine, without launching it right now.

    That is systemctl enable, undone by systemctl disable. Starting (start) and enabling are independent: a service can run without being enabled, or be enabled and stopped.

  • Ignoring the firewall, which ports are reachable from another machine on the network?

    ```text
    $ ss -tln
    State Recv-Q Send-Q Local Address:Port Peer Address:Port
    LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
    LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
    LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
    LISTEN 0 244 127.0.0.1:5432 0.0.0.0:*
    `

    • 22 et 80
    • 22, 80 et 5432
    • 80 seulement
    • 53 et 5432
    Show the answer

    22 et 80

    Only sockets on 0.0.0.0 accept outside connections: SSH (22) and the web server (80). The DNS stub (53) and the database (5432) are bound to the loopback and stay invisible to other machines.

  • The … nginx command tells whether the service runs, with the line Active: active (running), then shows its last journal lines.

    Show the answer

    The systemctl status nginx command tells whether the service runs, with the line Active: active (running), then shows its last journal lines.

    After a failed start, the line becomes Active: failed; journalctl -u nginx then gives the full message. status changes nothing about the service, it only reads its state.

  • Listening socket: what is it?

    Show the answer

    A server process's entry point, bound to an address and a port, waiting for clients' connections.

    An installed and started service is reachable only if it has a listening socket: ss -tln shows it in the LISTEN state.

  • The web server listens on 0.0.0.0:80 (ss confirms it) but a client gets Connection timed out. Probable cause, then fix?

    • The firewall drops the packets: open port 80
    • The service is not started: start it with systemctl
    • The service is not enabled: enable it for boot
    • The package is badly installed: reinstall it cleanly
    Show the answer

    The firewall drops the packets: open port 80

    ss proves the service listens. Silence until the timeout means a filter drops the packets; if nobody were listening, the machine would answer Connection refused at once.