How to reboot a remote machine and be able to use ssh again code example Example: How to restart Ubuntu via SSH? sudo service ssh restart