UDMP Persistence SSH Keys
Go to file
Stas Yakobov 0b0ab8a9c4 20230227.1322 2023-02-27 13:22:22 +02:00
.github Update FUNDING.yml 2022-08-01 13:44:49 +03:00
.gitignore initial release 2022-02-12 23:11:35 +02:00
99-ssh-keys.sh 20230227.1322 2023-02-27 13:22:22 +02:00
README.md 20230222.1257 2023-02-22 12:57:05 +02:00
install.sh 20230222.1257 2023-02-22 12:57:05 +02:00

README.md

UDM Persistence SSH Keys

Changelog

  • 2023-02-22 - Fixed support for UDM Pro Firmware 1.x and 2.x and 3.x - Must reinstall the script after upgrade from 1.x to 2.x

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

Compatibility

  • Tested on UDM PRO
  • UDM Pro doesn't support ed25519 SSH Keys

Installation

The script was tested on UDM PRO

(!) Depending on firmware your $DATA_DIR will be /mnt/data (Firmware 1.x) or /data (Firmware 2.x and 3.x)

curl -s https://raw.githubusercontent.com/fire1ce/UDM-Persistent-SSH-Keys/main/install.sh | sh

Add you public RSA keys to:

$DATA_DIR/ssh/authorized_keys

Uninstall

Delete the 99-ssh-keys.sh file

rm -rf $DATA_DIR/on_boot.d/99-ssh-keys.sh

Delete your authorized_keys file

rm -rf $DATA_DIR/ssh/authorized_keys

Usage

At boot the script with read the $DATA_DIR/ssh/authorized_keys file and add the content to UDM's /root/.ssh/authorized_keys

Manual run:

$DATA_DIR/on_boot.d/99-ssh-keys.sh