December 2018
Beginner
826 pages
22h 54m
English
systemd has a built-in way of generating the required override file we need.
Create the directory and file for the sshd.service unit using the following command:
$ sudo systemctl edit sshd.service
You will be placed in an empty file, but one that exists within a new directory, namely /etc/systemd/system/sshd.service.d/override.conf.
Copy the following into our empty file:
[Unit]Description=OpenSSH server daemon slightly modifiedDocumentation=man:ssh-additionalRequires=sshd-keygen.service[Service]Environment=OPTIONS="-u0"ExecStart=ExecStart=/usr/sbin/sshd -4 -D $OPTIONSRestartSec=10s
When we save and exit the file, an implicit systemctl daemon-reload is run, meaning that when we run a systemctl restart sshd, our new settings ...