I simply want to block all ssh connections on Linux. How can I proceed? My question is rather simple, so I see no point in providing excess nonsense. I tried to research and none of what I tried works, so please provide me with exact instructions.
There are a few ways to do this
Stop the SSH server (the exact command may vary, depending on distro and installed ssh server)
systemctl stop sshd
Use the firewall to block your SSH port, default 22 (this example is for
ufw block 22 && ufw reload
Disable networking altogether (pull the plug, rf kill switch...)
The simplest way of all to block all ssh connections is to remove just remove the ssh-server...
In most cases (Ubuntu, Mint, Debian and similar distributions) this will be
apt purge openssh-server.
I'm saying "most cases" because there are some cases (mentioned below) where removing the ssh-server works different (but this will probably not be the case on your system):
- You are not using openssh but libressh or another sshserver
- You did't install it using a deb-package
But as mentioned, normally you don't have to worry about this... Otherwise, rephrase your question.
Why don't you stop