In certain situations, you may have the need to reboot your Virtual Private Server (VPS) remotely. For example if the Remote Desktop of the VPS is frozen or hung and you have no other way of accessing the server, then a remote reboot would allow you to gain access to your VPS once again.
To support this functionality, we install OpenSSH server on all our Windows Virtual Private Servers. This allows you to connect remotely through SSH (also known as Secure Shell) and issue a reboot command.
- Install an SSH client on your computer. We highly recommend the most popular one - Putty (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
- Open the SSH client (we will use Putty in our example) and type the name of your remote VPS in the host name line. Your VPS name is in the form of nnnnaaa.2surgehost.com where n = numbers and a = alphabetical characters.
- Click the OPEN button.
- On the very FIRST time you connect to your VPS server, you will be prompted to add your VPS' public SSH key to your SSH client's cache. This ensures that the connection you are making is secured and that you trust the server is YOUR server. To accept the public key into your client's cache, click the YES button.Once you've added the public key into your cache, you will never be prompted for this again and subsequent SSH connection will go straight to the username / password prompt.
- Once you are connected to the VPS's SSH server session, you will be prompted to enter your username and password.The username is: administrator
The password is the one you use to connect to your Remote Desktop sessions.
- Once authenticated, you will see a prompt similar to the following:administrator@WIN-xxxxxxxxxx (where the x's are random alphanumeric characters)
- To reboot your VPS, type the following command and press the ENTER key:shutdown /r
This will perform a proper OS level shutdown and reboot the VPS. To see even more command line options for the main shutdown command, type in shutdown /?
- The shutdown process will begin in 60 seconds after you've entered the command. Once that occurs, give it another minute or 2 to reboot and you will then be able to access your VPS' desktop by using the RDP client in Windows.