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.
- Concepts
- Questions
- Sort and link
- 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 bysystemctl 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.0accept 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 nginxthen gives the full message.statuschanges 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 -tlnshows it in theLISTENstate.The web server listens on 0.0.0.0:80 (
ssconfirms it) but a client getsConnection 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
ssproves the service listens. Silence until the timeout means a filter drops the packets; if nobody were listening, the machine would answerConnection refusedat once.