Why not ssh.service but sshd.service?

The ssh service has always been named ssh in /etc/services, probably whatever the distribution, because it's the SSH protocol, not the sshd daemon.

Then it made sense, at least in the Debian implementation and thus Debian derivatives, the same name was chosen to start the service as ... service ssh start which translated into system-V style /etc/init.d/ssh.

This was kept in systemd, again for consistency since the service can be started indifferently with old style or systemd-style way. Still, an alias is also defined for compatibility with other distributions which made a different choice:

[Install]
WantedBy=multi-user.target
Alias=sshd.service

So both can be used on Debian and derivatives and they represent the same service.


As already established, different names are used in different distributions.

There are valid reasons for both

  • The server is called sshd, therefor sshd.service
  • sshd means "SSH Daemon" or "SSH Server", so "SSH Server Service" would be double.

So it would be a matter of preference of the distro maintainers. These preferences may also change over time, I remember a time when Suse switched from ntp to ntpd for the service name.

Tags:

Ssh

Systemd