I am developing a some code in order to communicate between a PC and a Raspberry Pi via SSH. When the PC opens a SSH connection to the RPi a window with a short message pops up on the RPi's screen. When there are no open SSH connections said window closes itself. Everything works just fine so far.
Now, I want to add a button in said window on the RPi in order to terminate all SSH incoming connections. Is there a Unix command for that? A Python module or method that does that would be fine as well, since the RPi's code is written in Python.
According to my research terminating a SSH connection can be done by killing the corresponding process via its PID. Since I want to kill all SSH processes/connections autonomously I am looking for an easier solution.
Thanks for your help!
(The Raspberry Pi runs on Raspbian 8 (jessie))