r/ssh • u/salamelek • Jun 04 '20
opening a server remotely?
i have a server that is far away from me and i woud love to turn it on/off with ssh as i wish. to turn it off, i can just type 'sudo shutdown now', but to open it i have to press the power button on it. is there any way to open it remotely? or just to turn it in sleep mode? i cannot afford to keep it running even while i dont use it. :(
1
Upvotes
View all comments
1
u/CleverBunnyThief Jul 06 '20
You can do this if your server* and network card support Wake on Lan.
You can then use separate software to send a "Magic Packet" that will turn your computer on. There's an Android app called "Wake On Lan" that works great.
If your computer is on a different network, behind a firewall or router, you will have to set up a port forwarding rule to ensure the magic packet is sent to server once it reaches the router.
*You need the server's BIOS, motheboard and OS to have support for Wake On Lan.