Why not ssh.service but sshd.service?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












When you have modified /etc/ssh/sshd_config, you may execute systemctl restart sshd.service to reflect the change. At least in my environment, also, systemctl restart ssh.service works. And systemctl --all list-units ssh* tells me there isn't any service with the name sshd.service. Then why is sshd.service used wide and actually valid?



(I know the name of ssh daemon is sshd but this is not the reasonable reason, I think.)




I executed the following commands on linux mint 19 (ubuntu-base) and volumio 2 (raspbian-base), both of which are based on debian.



systemctl restart sshd.service; echo $? #=> 0
systemctl restart ssh.service; echo $? #=> 0
systemctl --no-legend --all list-units ssh* #=> only ssh.service exists









share|improve this question























  • There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
    – jasonwryan
    Sep 5 at 5:45










  • ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
    – Bharat
    Sep 5 at 5:48










  • You should state your distribution, Suse uses sshd.service.
    – RalfFriedl
    Sep 5 at 5:49










  • @RalfFriedl Thank you. I added the distribution info.
    – ynn
    Sep 5 at 5:57














up vote
6
down vote

favorite












When you have modified /etc/ssh/sshd_config, you may execute systemctl restart sshd.service to reflect the change. At least in my environment, also, systemctl restart ssh.service works. And systemctl --all list-units ssh* tells me there isn't any service with the name sshd.service. Then why is sshd.service used wide and actually valid?



(I know the name of ssh daemon is sshd but this is not the reasonable reason, I think.)




I executed the following commands on linux mint 19 (ubuntu-base) and volumio 2 (raspbian-base), both of which are based on debian.



systemctl restart sshd.service; echo $? #=> 0
systemctl restart ssh.service; echo $? #=> 0
systemctl --no-legend --all list-units ssh* #=> only ssh.service exists









share|improve this question























  • There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
    – jasonwryan
    Sep 5 at 5:45










  • ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
    – Bharat
    Sep 5 at 5:48










  • You should state your distribution, Suse uses sshd.service.
    – RalfFriedl
    Sep 5 at 5:49










  • @RalfFriedl Thank you. I added the distribution info.
    – ynn
    Sep 5 at 5:57












up vote
6
down vote

favorite









up vote
6
down vote

favorite











When you have modified /etc/ssh/sshd_config, you may execute systemctl restart sshd.service to reflect the change. At least in my environment, also, systemctl restart ssh.service works. And systemctl --all list-units ssh* tells me there isn't any service with the name sshd.service. Then why is sshd.service used wide and actually valid?



(I know the name of ssh daemon is sshd but this is not the reasonable reason, I think.)




I executed the following commands on linux mint 19 (ubuntu-base) and volumio 2 (raspbian-base), both of which are based on debian.



systemctl restart sshd.service; echo $? #=> 0
systemctl restart ssh.service; echo $? #=> 0
systemctl --no-legend --all list-units ssh* #=> only ssh.service exists









share|improve this question















When you have modified /etc/ssh/sshd_config, you may execute systemctl restart sshd.service to reflect the change. At least in my environment, also, systemctl restart ssh.service works. And systemctl --all list-units ssh* tells me there isn't any service with the name sshd.service. Then why is sshd.service used wide and actually valid?



(I know the name of ssh daemon is sshd but this is not the reasonable reason, I think.)




I executed the following commands on linux mint 19 (ubuntu-base) and volumio 2 (raspbian-base), both of which are based on debian.



systemctl restart sshd.service; echo $? #=> 0
systemctl restart ssh.service; echo $? #=> 0
systemctl --no-legend --all list-units ssh* #=> only ssh.service exists






ssh systemd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 5 at 5:55

























asked Sep 5 at 5:33









ynn

495




495











  • There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
    – jasonwryan
    Sep 5 at 5:45










  • ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
    – Bharat
    Sep 5 at 5:48










  • You should state your distribution, Suse uses sshd.service.
    – RalfFriedl
    Sep 5 at 5:49










  • @RalfFriedl Thank you. I added the distribution info.
    – ynn
    Sep 5 at 5:57
















  • There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
    – jasonwryan
    Sep 5 at 5:45










  • ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
    – Bharat
    Sep 5 at 5:48










  • You should state your distribution, Suse uses sshd.service.
    – RalfFriedl
    Sep 5 at 5:49










  • @RalfFriedl Thank you. I added the distribution info.
    – ynn
    Sep 5 at 5:57















There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
– jasonwryan
Sep 5 at 5:45




There is no ssh.service: Failed to restart ssh.service: Unit ssh.service not found, unless your distro symlinks it.
– jasonwryan
Sep 5 at 5:45












ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
– Bharat
Sep 5 at 5:48




ssh is basically termed as a client, and sshd as a server... so sshd is more reasonable
– Bharat
Sep 5 at 5:48












You should state your distribution, Suse uses sshd.service.
– RalfFriedl
Sep 5 at 5:49




You should state your distribution, Suse uses sshd.service.
– RalfFriedl
Sep 5 at 5:49












@RalfFriedl Thank you. I added the distribution info.
– ynn
Sep 5 at 5:57




@RalfFriedl Thank you. I added the distribution info.
– ynn
Sep 5 at 5:57










2 Answers
2






active

oldest

votes

















up vote
16
down vote



accepted










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.






share|improve this answer




















  • Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
    – ynn
    Sep 5 at 6:31

















up vote
6
down vote













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.






share|improve this answer
















  • 2




    See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
    – JdeBP
    Sep 5 at 6:54











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466916%2fwhy-not-ssh-service-but-sshd-service%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
16
down vote



accepted










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.






share|improve this answer




















  • Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
    – ynn
    Sep 5 at 6:31














up vote
16
down vote



accepted










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.






share|improve this answer




















  • Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
    – ynn
    Sep 5 at 6:31












up vote
16
down vote



accepted







up vote
16
down vote



accepted






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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 5 at 6:13









A.B

3,5151721




3,5151721











  • Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
    – ynn
    Sep 5 at 6:31
















  • Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
    – ynn
    Sep 5 at 6:31















Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
– ynn
Sep 5 at 6:31




Thank you. Now I understand the structure. As you say, I could find the alias declaration in /lib/systemd/system/ssh.service.
– ynn
Sep 5 at 6:31












up vote
6
down vote













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.






share|improve this answer
















  • 2




    See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
    – JdeBP
    Sep 5 at 6:54















up vote
6
down vote













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.






share|improve this answer
















  • 2




    See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
    – JdeBP
    Sep 5 at 6:54













up vote
6
down vote










up vote
6
down vote









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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 5 at 6:03









RalfFriedl

3,7001523




3,7001523







  • 2




    See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
    – JdeBP
    Sep 5 at 6:54













  • 2




    See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
    – JdeBP
    Sep 5 at 6:54








2




2




See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
– JdeBP
Sep 5 at 6:54





See also unix.stackexchange.com/a/303302/5132 / askubuntu.com/a/856645/43344 for another commonly encountered set of differing service names.
– JdeBP
Sep 5 at 6:54


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466916%2fwhy-not-ssh-service-but-sshd-service%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?