Score:0

How to kill all incoming SSH connections?

za flag

I am developing a driver to remote control a Raspberry Pi over SSH. While this connection is active the RPi displays some message on it's touchscreen. So far everything works just fine.

The Raspberry Pi runs on Raspbian 8 (jessie).

Now, I want to be able to end the SSH connection on the RPi via some button click event. As far as I know, an incoming SSH connection can be terminated by getting the corresponding process' ID and killing it. On said button click event I want to kill all incoming sessions. Is there a shell command or Python module that does that for me? Extracting all running SSH connection's process IDs seems a bit to much work.

Thanks for your help!

ar flag
Are you using Raspberry Pi OS or Ubuntu? Which version? Please [edit your question](https://askubuntu.com/posts/1382471/edit) and add these information.
fk98 avatar
za flag
Done. @user68186
Bruni avatar
cn flag
This question should be asked here: https://raspberrypi.stackexchange.com or here https://unix.stackexchange.com/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.