How to shut down my server from SSH and restart it later?

Cheerag Nundlall

Well-known member
Registered
Joined
Oct 12, 2016
Messages
333
Points
18
As title asked, I want to shut down my server from SSH and restart it later. Is that possible?
 

Efe Agbontaen

Member
Registered
Joined
Sep 4, 2020
Messages
49
Points
6
If it is a VPS, you can only put it back on from your provider's Control Panel. Or through their API....

But you cannot put it back on via SSH
 

Kaz Wolfe

Well-known member
Registered
Joined
Jul 7, 2016
Messages
604
Points
28
It is simple to shut down your server or VPS by this command.

Code:
shutdown
But if you want to restart it, you need do that via your hosting control panel which your hosting provider sent it to you. :)
 

fiz

Well-known member
Hosting Provider
Registered
Joined
Aug 6, 2020
Messages
116
Points
16
As title asked, I want to shut down my server from SSH and restart it later. Is that possible?
SSH only works when the machine is running. When you turn off (shutdown) the machine, there is no SSH. You can use VNC though or as my friends said above: Your VPS Control Panel.
 

tuxandrew

Well-known member
Registered
Joined
Aug 19, 2012
Messages
126
Points
18
As title asked, I want to shut down my server from SSH and restart it later. Is that possible?

1. Just stop only the SSH service in the server.

2. Block the port 22 in firewall to block all incoming SSH connections to the server.

In this case, the server still be up and running, only the SSH service will be down for the server. Later you may restart the service and unblock the port through the control panel.
 

mehrdadali14

Member
Registered
Joined
Oct 10, 2017
Messages
49
Points
8
if you can't login to ssh then best is request your provider to give access you on VNC
 

sam@12

Member
Registered
Joined
Jun 8, 2021
Messages
62
Points
6
Hello,

Yes, it is possible to shutdown the server via SSH but restart is possible via control panel.
 

vikasjkn

Member
Registered
Joined
Nov 2, 2021
Messages
18
Points
1
You can shutdown server using below command


Code:
ssh -t [email protected] 'sudo shutdown -r 0'
But note, it must not be VPS hosting
 

MooseLucifer

Well-known member
Registered
Joined
May 20, 2016
Messages
149
Points
28
As title asked, I want to shut down my server from SSH and restart it later. Is that possible?
Interesting question!

Yes, it is possible to shut down and restart your server from SSH. To shut down the server, you can use the shutdown command with the appropriate options. For example, to shut down the server immediately you can use the command shutdown -h now. To restart the server later, you will need physical access to the server or remote access to its power management interface.

You can use the shutdown command with the -r option and a time argument to schedule a shutdown and restart of your server. For example, to schedule a shutdown in 24 hours and restart the server automatically after that time, you can use the command shutdown -r +1440. This will shut down the server in 1440 minutes (24 hours) and restart it automatically.

Hope it helps!
 
Recommended Threads
Replies
3
Views
2,600
Replies
2
Views
3,459
Replies
2
Views
1,803
Replies
4
Views
1,279

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top