[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sshd package systemd misconfiguration?



On Thursday, 15 September 2022 13:01:45 CEST, Greg Wooledge wrote:

of course the first thing i did was to check if all the files from the package were as they should be, and everything was fine!


It's supposed to be created as needed.  There should be two lines in
the unit file:

unicorn:/lib/systemd/system$ grep RuntimeDirectory ssh@.service
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755
unicorn:/lib/systemd/system$ grep RuntimeDirectory ssh.service
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755


i never questioned that! my problem wasn't based on these lines are missing or in some way altered. my problem resulted in these lines being there as they are! ;)


That should cause the /run/sshd directory to be created when the service
is started, and removed when it's stopped.

you got it! :)

having 'RuntimeDirectory=sshd' in ssh.service is totally fine! that is, b/c sshd runs as a daemon, and each new connection is handled by that exact daemon. so the /run/sshd directory stays there no matter how many connections to the host exist or being terminated, etc.

with ssh@.service it is completely different. for each connection there is a dedicated sshd process being started, and each one of them has the same /run/sshd directory assigned. and that's the problem if you have more than one connection to a given host. as soon as the first connection is terminated, the /run/sshd directory disappears, and the other sshd's might run into problems.

but i still don't understand, why this scenario prevents me from contacting a host with the formerly mentioned error message in the log file...

greetings...


Reply to: