UDM Persistent SSH Keys¶
UDM will discard any Authorized Keys for SSH every reboot or firmware upgrade. This script will allow you to persist your SSH keys in the UDM and survive reboots.
Github Repository: UDM Persistent SSH Keys
Persistence on Reboot¶
This script need to run every time the system is rebooted since the /root/.ssh/authorized_keys overwrites every boot.
This can be accomplished with a boot script. Flow this guide: UDM / UDMPro Boot Script
- Tested on UDM PRO
- UDM Pro doesn't support ed25519 SSH Keys
The script was tested on UDM PRO
curl -s https://raw.githubusercontent.com/fire1ce/UDM-Persistent-SSH-Keys/main/install.sh | sh
Add you public RSA keys to:
Delete the 99-ssh-keys.sh file
rm -rf /mnt/data/on_boot.d/99-ssh-keys.sh
Delete your authorized_keys file
rm -rf /mnt/data/ssh/authorized_keys
At boot the script with read the /mnt/data/ssh/authorized_keys file and add the content to UDM's /root/.ssh/authorized_keys