If you restart the OpenSSH server (sshd) on a Unix or Linux system, any existing connections to the server will be terminated. This is because the restart process stops the sshd daemon and then starts it again, which causes all existing connections to be terminated.
If you want to restart the sshd daemon without disrupting existing connections, you can use the "systemctl reload" command instead of the "systemctl restart" command. The "systemctl reload" command causes the sshd daemon to reload its configuration file without stopping and starting the daemon, which allows existing connections to remain active.
Here's an example of how to use the "systemctl reload" command to reload the sshd daemon:
systemctl reload sshd
Note: The "systemctl" command is a utility used to control the system services on a Unix or Linux system. It is available on most modern distributions of Linux and is used to start, stop, restart, and reload system services. The specific syntax and options of the "systemctl" command may vary depending on the operating system and version you are using. You can refer to the "systemctl" man page or online documentation for more information.