Fix Sshd Socket Activation When Using Tmux/screen

When using sshd.socket to start sshd on demand, detaching from a tmux/screen session will not work. The reason is once the ssh session is closed, systemd will terminate all remaining processes in the sshd cgroups, which affects also the tmux/screen background process. However this behaviour can be changed using the following drop-in file:

/etc/systemd/system/sshd@.service.d/killmode.conf
1
2
[Service]
KillMode=process

Comments