Skip to content

How to do

How to list connected devices in the network

arp

SSH Key-pair authentication (no password required)

You need to add your public keys in the ~/.ssh/authorized_keys of the host. Thee ssh-copy-id does that for you.

You need to generate a pair of keys before using this method. To do this, use ssh-keygen.

ssh-copy-id USER@REMOTE_HOST

Wake on Lan

This tutorial teaches how to setup a computer to start via the ethernet interface.

Step 1: Find the ethernet card MAC address

ifconfig

Step 2: Check if your ethernet card has WoL function

sudo ethtool enp2s0

Look for Wake-on: d. That means that it has the function but it is deactivated.

Step 3: Activate the WoL of your ethernet card

sudo ethtool --change enp2s0 wol g

You may also want to create a systemd action in order to not loose this configuration when the computer restarts.

sudo tee /etc/systemd/network/10-enp2s0.link << EOF
[Match]
MACAddress=xx:xx:xx:xx:xx:xx

[Link]
WakeOnLan=magic
EOF

Step 4: Set up port forward in your router

The WoL package is a UDP package that is usually sent to port 9. You may have to create a rule in your router that will forward the magic package to your device.

Step 5: Check if it is working

tcpdump 'udp port 9' -i enp2s0

Step 6: Send the magic package

wakeonlan <MAC_ADDRESS>

More information in this blog post.