(no title)
LaputanMachine | 2 years ago
For my use case, I run a Raspberry Pi that is on the same local network as my PC. When I connect to the Pi to forward my PC's RDP port to my laptop's loopback interface, the Pi sends a normal magic packet to wake my PC. All that was needed was an entry like this in my laptop's .ssh/config:
Host remote-desktop
HostName raspberry-pi
User pi
Port 1234
IdentityFile ~/.ssh/raspberry-pi-key
LocalForward 3389 my-pc.local:3389
SessionType default
RemoteCommand wakeonlan -i 192.168.178.255 11:22:33:44:55:66; cat
Each time the RDP port is forwarded, the wakeonlan command is run on the Raspberry Pi. The 'cat' at the end keeps the command from exiting so that the RDP port keeps being forwarded. (I also configured the NOPASSWD option for wakeonlan in /etc/sudoers so that no root privileges are needed to run it.)
t0astbread|2 years ago
LaputanMachine|2 years ago