In Ubuntu/Debian and its derivatives, executing the following commands restarts the SSH service:
# /etc/init.d/ssh restart.
# service ssh restart.
$ sudo service ssh restart.
$ sudo systemctl restart ssh