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