Turn on a remote computer
Guide
# use wake on lan
mkdir remote_on# use wake on lan
cd remote_on
echo "..." > MAC_ADDR# use wake on lan
MAC_FILE="$(dirname "$0")/MAC_ADDR"
etherwake -i eth0 "$(cat "$MAC_FILE")"Last updated
I have a machine that I use to do lot of work. However, I want to avoid having it on 24/7. Hence, sometiems I need to turn it on remotely to start working
To turn on your computer remotely, you need to be in the same network and then use the protocol "Wake-on-Lan." Read below for a step-by-step guide.
Be in the same network. I recommend having a Raspberry Pi on 24/7, which you can SSH into anytime. Alternatively, you can use a VPN to connect to your network (also via a Raspberry Pi).
SSH into the Raspberry
Create a directory for managing this operation.
# use wake on lan
mkdir remote_onFind out the MAC address of your computer. You can do it. Then save it in file MAC_ADDR:
# use wake on lan
cd remote_on
echo "..." > MAC_ADDRIf not available, install a client to use Wake-on-Lan. I use etherwake.
Draft a script to do the job
# use wake on lan
MAC_FILE="$(dirname "$0")/MAC_ADDR"
etherwake -i eth0 "$(cat "$MAC_FILE")"Make the script executable
Add an alias to your .bashrc like:
Wake on Lan:
Arch guide (Note: on TUF B550M ASUS bios (manual, pg. 31), enable option “Power On By PCI-E”)
Last updated
chmod +x /home/pi/remote_on/script.shalias turnon='sudo /home/pi/remote_on/script.sh'