So you can use the functionalities of the Init-System of your choice [Like SystemD, RunIt, OpenRC, SysVinit etc...] to influence the behaviour/state of your SSH-Server, here are some examples:-
- systemctl start sshd = Starts your SSH-Server
- systemctl stop sshd = Stops your SSH-Server (But it does not terminate your current SSH-connection until you terminate it manually)
- systemctl restart sshd = Restarts your SSH-Server
- systemctl enable sshd = Shows the status of your SSH-Server
- systemctl status sshd = Enables your SSH-Server at boot/during boot
#Port 22 --> Port 2222
Here we UN-COMMENTED & changed the PORT-NUMBER
PermitRootLogin yes --> PermitRootLogin no
Here we changed the VALUE from "yes" to "no"
#PasswordAuthentication yes --> PasswordAuthentication no
Here we UN-COMMENTED & changed the VALUE from "yes" to "no"
Here it is shown that we can change PORTS to deter bots & most hackers. We can also deny ROOT-Logins for Non-ROOT Users [AKA Users that neither you nor other System-Administrators]. But most importantly you can disable PASSWORD-AUTHENTICATION inorder to make sure that you & others can login via SSH-KEYS ONLY
So now in order to confirm & update the remote-server with your new settings/configurations just simply RESTART & check the STATUS of the SSH-Server via your Init-System+SSHD