From the info you provided, I am assuming you are connected in to a terminal on the remote system and are working on the command line.
You can edit the /etc/ssh/sshd_config file to make your changes. Nothing will take effect until you have sshd reload the configuration. I suggest making a backup copy of that file before editing it.
Test your changes by running sudo sshd -t
in a terminal and if it gives you errors, fix them until that command doesn't return any issues. When you are happy that your changes aren't going to break anything, you can run sudo systemctl reload sshd
or sudo systemctl restart sshd
. Your existing sessions should remain active until you close them. Although I am not sure that will be the case if your sshd_config changes would introduce rules preventing your current connection being re-established. If you figure that out, please comment on this answer and let me know!
And if you need to stop and start services, use sudo systemctl stop ...
and sudo systemctl start ...
not disable and enable. Those do different things.
When you want to learn a bit more and see where I found the answer for you, run and read the output of man sshd
, man sshd_config
, and man systemctl
.