I have a system that runs multiple sshd daemons. Each daemon listens to a separate port.
How can I terminate all sessions started by a specific daemon without affecting other ssh sessions?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
If you know the ssh port, you can simply kill all current tcp sessions that were initiated through it:
ss -K dport 22
This kills all active ssh sessions that were started through port 22 while leaving other ssh sessions intact. Don't forget to stop the
sshd daemon before you kill off its sessions.