reboot a server through linux terminal code example Example 1: command to restart linux sudo reboot Example 2: How to restart Ubuntu via SSH? sudo service ssh restart