[systemd-devel] Query on sshd.socket sshd.service approaches

Andrei Borzenkov arvidjaar at gmail.com
Wed Mar 6 06:52:59 UTC 2024


On Wed, Mar 6, 2024 at 8:41 AM Shreenidhi Shedi
<shreenidhi.shedi at broadcom.com> wrote:
>
> Hi All,
>
> What is the rationale behind using sshd.socket other than not keeping sshd daemon running always and reducing memory consumption?

Neither is provided by systemd, so I guess this question is better
addressed to the project that ships these units. Recently systemd
added generators for the ssh which do not work without socket units at
all (like VSOCK inside VM), but that is orthogonal to running the
traditional sshd.

> With sshd.socket, systemd does a fork/exec on each connection which is expensive and with the sshd.service approach server will just connect with the client which is less expensive and faster compared to sshd.socket.
>
> And if there are issues in unit files like in https://github.com/systemd/systemd/issues/29897 it will make the system unusable.
>
> I want to understand this better and know more on the history behind these design decisions. Thanks.
>
> --
> Shedi


More information about the systemd-devel mailing list