You are not logged in.
If I login to the system via ssh and then stop the sshd server with "systemctl stop sshd", the system does not accept new ssh connection anymore. But active sessions continue to be active. Is it a normal behaviour? I would have expected that stopping sshd would terminate any current inbound ssh connection.
Last edited by olive (2016-12-01 20:25:59)
Offline
It's expected. That way you can restart sshd when you are using it, and not be disconnected.
Offline
This is as ataraxia says, expected. However, if your server/machines are in same location like a home net or office), you could still use iptables/nft to change the behaviour of established packets I would think to alter that behaviour.
I say local because if your machine is remotely, you really _want_ that default behaviour You can of course also create a custom service file, which fires when sshd is stopped/restarted/disabled say, which would pgrep all ssh sessions and kill them for example.
Last edited by solar (2016-12-02 14:38:50)
I am hilariously insane. yup. you won't notice though.. I promise...I think.
Offline
Would not setting
KillMode=control-group
in sshd.service give the desired behavior? ( sorry not tested this )
Offline